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 characters
| for (i = 0; i < navigator.plugins.length; i++) { console.log(navigator.plugins[i].name + ' '); } |
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 characters
| Sublime3 format. | |
| Find: ( *)([A-Z0-9-]+)\:(.*) | |
| Replace: $1\L$2: $4 |
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 characters
| # One liner! | |
| # Finds all duplicate CSS classes in a CSS file, and ignores hex colour codes (the #DDDDDD pattern would be a false positve) | |
| Get-Content .\filename.css | ForEach-Object { $_.Split(" ,.", [System.StringSplitOptions]::RemoveEmptyEntries) } | ForEach-Object { $_.Trim() } | where { ($_[0] -eq "#" -or $_[0] -eq "." ) -and (!$_.EndsWith(";")) } | where {$_ -notmatch '#[0-9a-fA-F]{2,}$'} | sort-object | group-object | where-object { $_.Count -gt 1 } |
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 characters
| // Paste this in your Chrome/FireFox console | |
| // The DOM accessibility tree will be printed | |
| function getRoleTree() { | |
| var tree = { text: "document", children: [] }; | |
| var dataTree = { 'core' : { 'data' : [ tree ]}}; | |
| var walk_the_DOM = function walk(node, tree, func) { | |
| tree = func(node, tree); |
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 characters
| <div style="border:1px solid blue; margin: 5px; padding: 5px;"> | |
| <label data-bind="text: labelText"></label> | |
| <input type="text" /> | |
| </div> |
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 characters
| public static COLOR_RESET = '\x1b[0m'; | |
| public static COLOR_BRIGHT = '\x1b[1m'; | |
| public static COLOR_DIM = '\x1b[2m'; | |
| public static COLOR_UNDERSCORE = '\x1b[4m'; | |
| public static COLOR_BLINK = '\x1b[5m'; | |
| public static COLOR_REVERSE = '\x1b[7m'; | |
| public static COLOR_HIDDEN = '\x1b[8m'; | |
| public static COLOR_FGBLACK = '\x1b[30m'; | |
| public static COLOR_FGRED = '\x1b[31m'; |