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
| function scale_photos() | |
| { | |
| $('#thumbs li').each(function() { | |
| scale_photo($(this)); | |
| }); | |
| } | |
| function scale_photo($el) | |
| { | |
| var width = $el.width(); |
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
| if (preg_match('/^rgb\(([0-9]+),\s*([0-9]+),\s*([0-9]+)\)$/', $_GET['rgb'], $m) && count($m) == 4) | |
| { | |
| echo '#'.join('', array_map(function($n) { return str_pad(dechex($n), 2, '0', STR_PAD_LEFT); }, array_slice($m, 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
| function visit_nodes_iterative(node) { | |
| node = node || document; | |
| do | |
| { | |
| /* Do something with node here */ | |
| node = node.firstChild || node.nextSibling || function() { | |
| while ((node = node.parentNode) && !node.nextSibling); | |
| return node ? node.nextSibling : null; |
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
| { | |
| "max_length": 80, | |
| "tab_width": 4, | |
| "replace_tabs": true, | |
| "show_content": true, | |
| "show_filenames": null, | |
| "show_line_numbers": true, | |
| "show_length": true | |
| } |
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
| <?php | |
| if (($arg = array_shift($args)) == '--') { | |
| break; | |
| } |
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
| <?php | |
| if ($arg == "--help") { | |
| fwrite(STDOUT, usage(true)); | |
| exit(0); | |
| } |
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
| <?php | |
| for ($ch = 1; $ch < strlen($arg); $ch++) { | |
| switch ($arg[$ch]) { | |
| case 'c': $opts['show_content'] = false; break; | |
| case 'm': $opts['max_length'] = handle_arg(substr($arg, $ch), $args); break; | |
| //... | |
| } | |
| } |
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
| <?php | |
| while (count($args) && $args[0][0] == "-") { | |
| //... | |
| } |
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
| <?php | |
| fwrite(STDERR, "bad error: no config file. install one.\n"); |
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
| <?php | |
| exit(ERR_BAD_CONFIG); |
OlderNewer