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
| package main | |
| import ( | |
| "bytes" | |
| ) | |
| const newline = "\n" | |
| const alive = "O" | |
| const dead = "." |
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 | |
| BlowfishService::init(); | |
| /** | |
| * Blowfish password hashing service | |
| * | |
| * This class will throw (immediately on load) on PHP versions prior to 5.3.2, which | |
| * did not support the Blowfish algorithm. (and/or would fall back to DES.) | |
| * |
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
| /** | |
| * This function allows for definition of CSS rules at run-time | |
| */ | |
| window.addRule = (function() { | |
| var el; | |
| return function(selector, rule) { | |
| if (!el) { | |
| if (document.createStyleSheet) { |
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
| /* main container: */ | |
| #test { | |
| clear: both; | |
| width: 100%; | |
| min-width: 240px; | |
| max-width: 790px; | |
| height: 320px; | |
| overflow: hidden; | |
| font-family: Verdana, Arial; |
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 id="test"> | |
| <div class="slide"> | |
| <img src="http://farm4.staticflickr.com/3125/2629096658_8c57d707b3_z.jpg"/> | |
| </div> | |
| <div class="slide" data-delay="2"> | |
| <img src="http://farm7.staticflickr.com/6143/5951493219_f65139d65a_z.jpg"/> | |
| </div> | |
| <div class="slide" data-delay="5"> | |
| <img src="http://farm1.staticflickr.com/89/253367473_74a5c4dae2_z.jpg"/> | |
| </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
| <form method="post"> | |
| <input type="hidden" name="hidden" value="this won't be included"/> | |
| <div style="display:none"> | |
| <input type="text" name="hidden_text" value="this can be filtered"/> | |
| </div> | |
| <input type="password" name="password"/><br> | |
| <input type="text" name="text"/><br> | |
| <input type="checkbox" name="checkboxes" value="a"/> a | |
| <input type="checkbox" name="checkboxes" value="b"/> b | |
| <input type="checkbox" name="checkboxes" value="c"/> c <br> |
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
| /* | |
| And now for a demonstration... | |
| Note that this little script is shorter than the equivalent hand-written HTML code. | |
| I didn't benchmark it, but it's likely faster than inserting and parsing HTML too, | |
| since document.createElement() is used when creating the elements, and that is | |
| generally about 10 times faster than parsing out HTML. | |
| */ |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script type="text/javascript"> | |
| function outside() { | |
| function inside(message) { | |
| window.alert(message); |
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 | |
| /** | |
| * Simple (forward migration) command-line SQL script runner for MySQL. | |
| * | |
| * To initialize the ".upgrade" file: | |
| * | |
| * php upgrade.php --init | |
| * | |
| * To flag all SQL files as applied (in the status file) without actually doing any work: |
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
| /** | |
| * Sort a list of elements and apply the order to the DOM. | |
| */ | |
| jQuery.fn.order = function(asc, fn) { | |
| fn = fn || function (el) { | |
| return $(el).text().replace(/^\s+|\s+$/g, ''); | |
| }; | |
| var T = asc !== false ? 1 : -1, | |
| F = asc !== false ? -1 : 1; | |
| this.sort(function (a, b) { |