Revisions
-
addyosmani revised this gist
Oct 6, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ CSS Layout Debugger ===================== A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color. -
addyosmani revised this gist
Sep 29, 2014 . 1 changed file with 0 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +0,0 @@ -
addyosmani revised this gist
Sep 29, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, September 2014 Copyright (C) 2014 Addy Osmani @addyosmani -
addyosmani revised this gist
Sep 28, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ CSS Layout Debbuger ===================== A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color. **One-line version to paste in your DevTools** -
addyosmani revised this gist
Sep 27, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,7 +43,7 @@ Tested in IE: Thanks to [gregwhitworth](https://twitter.com/gregwhitworth/status/515533526549024768) for verifying. # Tag Specific Layout Debugging In 82 Bytes My original implementation outlined each DOM element on the page with a random (valid) hex color. -
addyosmani revised this gist
Sep 27, 2014 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -45,7 +45,9 @@ Thanks to [gregwhitworth](https://twitter.com/gregwhitworth/status/5155335265490 # Improvement: Tag Specific Color Highlighting My original implementation outlined each DOM element on the page with a random (valid) hex color. Thanks to the work by @aemkei, @p01, @sindresorhus and other commenters, we now have an even shorter version (108 bytes golfed down to 82) that uses a specific hex color *per tag name*. This lets you visually group elements similar to how pesticide.io does. ```js for(i=0;A=$$("*")[i++];)A.style.outline="solid hsl("+(A+A).length*9+",99%,50%)1px" -
addyosmani revised this gist
Sep 27, 2014 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -45,7 +45,7 @@ Thanks to [gregwhitworth](https://twitter.com/gregwhitworth/status/5155335265490 # Improvement: Tag Specific Color Highlighting My original implementation outlined each DOM element on the page with a random (valid) hex color. Thanks to the work by @aemkei, @p01, @sindresorhus and other commenters, we now have an even shorter version (108 bytes golfed down to 82) that uses a specific hex color *per tag name*. This lets you visually group elements similar to how pesticide.io does. ```js for(i=0;A=$$("*")[i++];)A.style.outline="solid hsl("+(A+A).length*9+",99%,50%)1px" @@ -54,3 +54,5 @@ for(i=0;A=$$("*")[i++];)A.style.outline="solid hsl("+(A+A).length*9+",99%,50%)1p Preview:  Thanks for the awesome help improving this folks <3 -
addyosmani revised this gist
Sep 27, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,7 +43,7 @@ Tested in IE: Thanks to [gregwhitworth](https://twitter.com/gregwhitworth/status/515533526549024768) for verifying. # Improvement: Tag Specific Color Highlighting There are several optimizations made in the comments that improve on the original source - check em' out. One that goes beyond code-golfing in this version by @aemkei that mimics pesticide.io, using a specific color for every tag name: @@ -53,4 +53,4 @@ for(i=0;A=$$("*")[i++];)A.style.outline="solid hsl("+(A+A).length*9+",99%,50%)1p Preview:  -
addyosmani revised this gist
Sep 27, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -48,7 +48,7 @@ Thanks to [gregwhitworth](https://twitter.com/gregwhitworth/status/5155335265490 There are several optimizations made in the comments that improve on the original source - check em' out. One that goes beyond code-golfing in this version by @aemkei that mimics pesticide.io, using a specific color for every tag name: ```js for(i=0;A=$$("*")[i++];)A.style.outline="solid hsl("+(A+A).length*9+",99%,50%)1px" ``` Preview: -
addyosmani revised this gist
Sep 26, 2014 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,3 +42,15 @@ Tested in IE:  Thanks to [gregwhitworth](https://twitter.com/gregwhitworth/status/515533526549024768) for verifying. # Improvements There are several optimizations made in the comments that improve on the original source - check em' out. One that goes beyond code-golfing in this version by @aemkei that mimics pesticide.io, using a specific color for every tag name: ```js for(i=0;A=$$("*")[i++];)A.style.outline="1px solid hsl("+(A+A).length*9+",99%,50%)" ``` Preview:  -
addyosmani revised this gist
Sep 26, 2014 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,3 +36,9 @@ Tested from Firefox DevTools: Tested from WebKit Nightlies (Safari):  Tested in IE:  Thanks to [gregwhitworth](https://twitter.com/gregwhitworth/status/515533526549024768) for verifying. -
addyosmani revised this gist
Sep 26, 2014 . 4 changed files with 11 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,18 +7,18 @@ A tweet-sized debugger for visualizing your CSS layouts. Gives every DOM element Use `$$` if your browser aliases it: ~ 108 byte version ```javascript [].forEach.call($$("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)}) ``` Using `document.querySelectorAll`: ~ 131 byte version ```javascript [].forEach.call(document.querySelectorAll("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)}) ``` If you're looking for a proper version that uses a set color per tag type, check out [pesticide.io](http://pesticide.io). This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,9 @@ function(a){ // Supply a valid selector (e.g '*' for [].forEach.call( // Treat Nodelist as an Array (fewer bytes than Array.prototype.forEach.call(...);) // Gets the prototype of Array & uses call to execute the function on the NodeList. document.querySelectorAll(a), // Query DOM for elements matching the supplied selector // (For 108 bytes, use $$() as Chrome, Safari & FF expose it in DevTools) function(b){ b.style.outline = "1px solid #" + // Set the selector outline (~~(Math.random()*(1<<24))) // Pick a valid random CSS hex color .toString(16)}) // Convert to a base 16 number. BOOM. } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1 @@ function(a){return [].forEach.call(document.querySelectorAll(a),function(b){b.style.outline = "1px solid #" +(~~(Math.random()*(1<<24))).toString(16)});} This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,9 +24,9 @@ // (For 110 bytes, use $$() as Chrome, Safari & FF expose it in DevTools) function(b){ b.style.outline = "1px solid #" + // Set the selector outline (~~(Math.random()*(1<<24))) // Pick a valid random CSS hex color .toString(16)}) // Convert to a base 16 number. BOOM. } myFunction('*'); </script> <!-- quick JSBin:http://jsbin.com/soseq/2/edit --> -
addyosmani revised this gist
Sep 26, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ CSS Layout Debbuger ===================== A tweet-sized debugger for visualizing your CSS layouts. Gives every DOM element on your page a random (valid) CSS hex color. **One-line version to paste in your DevTools** -
addyosmani revised this gist
Sep 26, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,3 +29,4 @@ } myFunction('*'); </script> <!-- quick JSBin:http://jsbin.com/soseq/1/edit --> -
addyosmani revised this gist
Sep 26, 2014 . 1 changed file with 8 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,13 +17,15 @@ <div>I am element</div> <div>I am element</div> <script> var myFunction = function(a){ // Supply a valid selector (e.g '*' for wildcard) [].forEach.call( // Treat Nodelist as an Array (fewer bytes than Array.prototype.forEach.call(...);) // Gets the prototype of Array & uses call to execute the function on the NodeList. document.querySelectorAll(a), // Query DOM for elements matching the supplied selector // (For 110 bytes, use $$() as Chrome, Safari & FF expose it in DevTools) function(b){ b.style.outline = "1px solid #" + // Set the selector outline (+~~(Math.random()*(1<<24))) // Pick a valid random CSS hex color .toString(16)}); // Convert to a base 16 number. BOOM. } myFunction('*'); </script> -
addyosmani revised this gist
Sep 26, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ function(a){ // Supply a valid selector (e.g '*' for wildcard) [].forEach.call( // Treat Nodelist as an Array (fewer bytes than Array.prototype.forEach.call(...);) // Gets the prototype of Array & uses call to execute the function on the NodeList. document.querySelectorAll(a), // Query DOM for elements matching the supplied selector // (For 110 bytes, use $$() as Chrome, Safari & FF expose it in DevTools) function(b){ -
addyosmani revised this gist
Sep 26, 2014 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ function(a){ // Supply a valid selector (e.g '*' for wildcard) [].forEach.call( // Convert Nodelist -> Array document.querySelectorAll(a), // Query DOM for elements matching the supplied selector // (For 110 bytes, use $$() as Chrome, Safari & FF expose it in DevTools) function(b){ b.style.outline = "1px solid #" + // Set the selector outline (+~~(Math.random()*(1<<24))) // Pick a valid random CSS hex color -
addyosmani revised this gist
Sep 26, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,7 +31,7 @@ Tested from Chrome DevTools: Tested from Firefox DevTools:  Tested from WebKit Nightlies (Safari): -
addyosmani revised this gist
Sep 26, 2014 . 2 changed files with 19 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,12 +5,12 @@ A tweet-sized debugger for visualizing your CSS layouts. **One-line version to paste in your DevTools** Use `$$` if your browser aliases it: ~ 110 byte version ```javascript [].forEach.call($$("*"),function(a){a.style.outline="1px solid #"+(+~~(Math.random()*(1<<24))).toString(16)}); ``` Using `document.querySelectorAll`: @@ -21,4 +21,18 @@ Using `document.querySelectorAll`: [].forEach.call(document.querySelectorAll("*"),function(a){a.style.outline="1px solid #"+(+~~(Math.random()*(1<<24))).toString(16)}); ``` If you're looking for a proper version that uses a set color per tag type, check out [pesticide.io](http://pesticide.io). ## Screenshots Tested from Chrome DevTools:  Tested from Firefox DevTools:  Tested from WebKit Nightlies (Safari):  This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ function(a){ // Supply a valid selector (e.g '*' for all) [].forEach.call( // Convert Nodelist -> Array document.querySelectorAll(a), // Query for the selector (For 110 bytes, use $$() as Chrome, Safari & FF expose it in DevTools) function(b){ b.style.outline = "1px solid #" + // Set the selector outline (+~~(Math.random()*(1<<24))) // Pick a valid random CSS hex color -
addyosmani revised this gist
Sep 26, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ A tweet-sized debugger for visualizing your CSS layouts. **One-line version to paste in your DevTools** Use `$` or `$$` if your browser aliases it: ~ 109 byte version @@ -21,4 +21,4 @@ Using `document.querySelectorAll`: [].forEach.call(document.querySelectorAll("*"),function(a){a.style.outline="1px solid #"+(+~~(Math.random()*(1<<24))).toString(16)}); ``` If you're looking for a proper version that uses a set color per tag type, check out [pesticide.io](http://pesticide.io). -
addyosmani revised this gist
Sep 26, 2014 . 2 changed files with 11 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ function(a){ // Supply a valid selector (e.g '*' for all) [].forEach.call( // Convert Nodelist -> Array document.querySelectorAll(a), // Query for the selector (For 109 bytes, use $() as Chrome & FF expose it in DevTools) function(b){ b.style.outline = "1px solid #" + // Set the selector outline (+~~(Math.random()*(1<<24))) // Pick a valid random CSS hex color .toString(16)}); // Convert to a base 16 number. BOOM. } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,17 +17,13 @@ <div>I am element</div> <div>I am element</div> <script> var myFunction = function(a){ // Supply a valid selector (e.g '*' for all) [].forEach.call( // Convert Nodelist -> Array document.querySelectorAll(a), // Query for the selector (could be shortened to $() as Chrome & FF expose it in DevTools) function(b){ b.style.outline = "1px solid #" + // Set the selector outline (+~~(Math.random()*(1<<24))) // Pick a valid random CSS hex color .toString(16)}); // Convert to a base 16 number. BOOM. } myFunction('*'); </script> -
addyosmani revised this gist
Sep 26, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ function(a){ // Supply a valid selector (e.g '*' for all) [].forEach.call( // Convert Nodelist -> Array document.querySelectorAll(a), // Query for the selector (For 109 bytes, use $() as Chrome & FF expose it in DevTools) function(b){ b.style.outline = "1px solid #" + // Set the selector outline (+~~(Math.random()*(1<<24))) // Pick a valid random CSS hex color -
addyosmani revised this gist
Sep 25, 2014 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ CSS Layout Debbuger ===================== A tweet-sized debugger for visualizing your CSS layouts. @@ -19,4 +19,6 @@ Using `document.querySelectorAll`: ```javascript [].forEach.call(document.querySelectorAll("*"),function(a){a.style.outline="1px solid #"+(+~~(Math.random()*(1<<24))).toString(16)}); ``` If you're looking for a non-toy version of the script, check out pesticide.io. -
addyosmani revised this gist
Sep 25, 2014 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,12 +7,16 @@ A tweet-sized debugger for visualizing your CSS layouts. Using `$` if your browser aliases it: ~ 109 byte version ```javascript [].forEach.call($("*"),function(a){a.style.outline="1px solid #"+(+~~(Math.random()*(1<<24))).toString(16)}); ``` Using `document.querySelectorAll`: ~ 132 byte version ```javascript [].forEach.call(document.querySelectorAll("*"),function(a){a.style.outline="1px solid #"+(+~~(Math.random()*(1<<24))).toString(16)}); ``` -
addyosmani revised this gist
Sep 25, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ CSS Layout Debuger A tweet-sized debugger for visualizing your CSS layouts. **One-line version to paste in your DevTools** Using `$` if your browser aliases it: -
addyosmani revised this gist
Sep 25, 2014 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,8 +3,16 @@ CSS Layout Debuger A tweet-sized debugger for visualizing your CSS layouts. One-line version to paste in your DevTools Using `$` if your browser aliases it: ```javascript [].forEach.call($("*"),function(a){a.style.outline="1px solid #"+(+~~(Math.random()*(1<<24))).toString(16)}); ``` Using `document.querySelectorAll`: ```javascript [].forEach.call(document.querySelectorAll("*"),function(a){a.style.outline="1px solid #"+(+~~(Math.random()*(1<<24))).toString(16)}); ``` -
addyosmani revised this gist
Sep 25, 2014 . 6 changed files with 50 additions and 55 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2014 Copyright (C) 2014 Addy Osmani @addyosmani Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,32 +1,10 @@ CSS Layout Debuger ===================== A tweet-sized debugger for visualizing your CSS layouts. One-line version to paste in your DevTools: ```javascript [].forEach.call($("*"),function(a){a.style.outline="1px solid #"+(+~~(Math.random()*(1<<24))).toString(16)}); ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,8 @@ function(a){ // Supply a valid selector (e.g '*' for all) [].forEach.call( // Convert Nodelist -> Array document.querySelectorAll(a), // Query for the selector (could be shortened to $() as Chrome & FF expose it in DevTools) function(b){ b.style.outline = "1px solid #" + // Set the selector outline (+~~(Math.random()*(1<<24))) // Pick a valid random CSS hex color .toString(16)}); // Convert to a base 16 number. BOOM. } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1 @@ function(a){return [].forEach.call(document.querySelectorAll(a),function(b){b.style.outline = "1px solid #" +(+~~(Math.random()*(1<<24))).toString(16)});} This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,11 @@ { "name": "CSSLayoutDebugger", "description": "A helper for debugging CSS layouts", "keywords": [ "css", "layout", "debugger" ] } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,33 @@ <!DOCTYPE html> <title>CSS Layout Debugger</title> <div>I am element</div> <div>I am element</div> <div>I am element</div> <div>I am element</div> <div>I am element</div> <div>I am element</div> <div>I am element</div> <div>I am element</div> <div>I am element</div> <div>I am element</div> <div>I am element</div> <div>I am element</div> <div>I am element</div> <div>I am element</div> <div>I am element</div> <div>I am element</div> <script> // write a small example that shows off the API for your example // and tests it in one fell swoop. var myFunction = function(a){ // Supply a valid selector (e.g '*' for all) [].forEach.call( // Convert Nodelist -> Array document.querySelectorAll(a), // Query for the selector (could be shortened to $() as Chrome & FF expose it in DevTools) function(b){ b.style.outline = "1px solid #" + // Set the selector outline (+~~(Math.random()*(1<<24))) // Pick a valid random CSS hex color .toString(16)}); // Convert to a base 16 number. BOOM. } myFunction('*'); </script> -
140bytes revised this gist
Jul 28, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,7 @@ All entries must also be licensed under the [WTFPL](http://sam.zoy.org/wtfpl/) o For more information -------------------- See the [140byt.es](http://140byt.es) site for a showcase of entries (built itself using 140-byte entries!), and follow [@140bytes](http://twitter.com/140bytes) on Twitter. To learn about byte-saving hacks for your own code, or to contribute what you've learned, head to [the wiki](https://github.com/jed/140bytes/wiki/Byte-saving-techniques). -
140bytes revised this gist
Jul 28, 2011 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,8 +25,8 @@ All entries must also be licensed under the [WTFPL](http://sam.zoy.org/wtfpl/) o For more information -------------------- See the [140byt.es](http://140byt.es) for a showcase of entries built itself using 140-byte entries, and follow [@140bytes](http://twitter.com/140bytes) on Twitter. To learn about byte-saving hacks for your own code, or to contribute what you've learned, head to [the wiki](https://github.com/jed/140bytes/wiki/Byte-saving-techniques). 140byt.es is brought to you by [Jed Schmidt](http://jed.is), with help from Alex Kloss. It was inspired by work from [Thomas Fuchs](http://mir.aculo.us) and [Dustin Diaz](http://www.dustindiaz.com/). -
140bytes revised this gist
Jun 1, 2011 . 1 changed file with 5 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,12 @@ <!DOCTYPE html> <title>Foo</title> <div>Expected value: <b>undefined</b></div> <div>Actual value: <b id="ret"></b></div> <script> // write a small example that shows off the API for your example // and tests it in one fell swoop. var myFunction = function(){ /* the code here should be identical to the entry. */ } document.getElementById( "ret" ).innerHTML = myFunction() </script>
NewerOlder