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
| var rekapi = new Rekapi(); | |
| var textPathActor = rekapi.addActor({ | |
| // This actor setup function performs some initial preparation work. This is | |
| // where KineticJS is set up and given an initial state. | |
| setup: function () { | |
| var stage = new Kinetic.Stage({ | |
| container: 'container', | |
| width: 578, | |
| height: 220 | |
| }); |
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
| var rekapi = new Rekapi(document.body); | |
| var actor = rekapi.addActor({context: document.getElementById('my-actor')}); | |
| // Assumes isMobile is defined somewhere | |
| if (isMobile()) { | |
| actor | |
| .keyframe(0, { | |
| transform: 'translateX(0px) translateY(0px)' | |
| }) |
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
| curl https://raw2.github.com/atebits/Words/master/Words/en.txt | while read line; do say $line; done |
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
| $: rm foo-dir/ | |
| rm: cannot remove `foo-dir/': Is a directory | |
| $: rm -r foo-dir/ | |
| rm: cannot remove `foo-dir': Not a directory |
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
| var rekapi = new Rekapi(); | |
| rekapi.canvasRenderer = new Rekapi.CanvasRenderer(rekapi, document.querySelector('canvas').getContext('2d')); | |
| rekapi.domRenderer = new Rekapi.DOMRenderer(rekapi); | |
| typeof rekapi.renderer; // 'undefined' |
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
| #!/bin/bash | |
| # Open the page in 500 in milliseconds. This is done with a timer so that | |
| # http-server can be ctrl-c'ed and the browser doesn't open to a 404-ing page. | |
| echo " | |
| setTimeout(function () { | |
| require('open')('http://localhost:9000'); | |
| }, 500); | |
| " | node |
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 | |
| // Adapted from: http://www.nolte-schamm.za.net/2011/05/php-var_dump-into-error-console_log/ | |
| function console_log ($obj) { | |
| ob_start(); | |
| var_dump($obj); | |
| $contents = ob_get_contents(); | |
| ob_end_clean(); | |
| error_log($contents); | |
| } |
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 tryAgain (fn) { | |
| try { | |
| fn(); | |
| } catch (e) { | |
| tryAgain(fn); | |
| } | |
| } |
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
| <ol> | |
| <li>Thing 1</li> | |
| <li>Thing 2</li> | |
| <li>Dr. Seuss reference ends here.</li> | |
| </ol> |
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
| [1,2,3,4,5].forEach(function (i) { | |
| setTimeout(function () { | |
| console.log(i); | |
| }, 0); | |
| }); | |
| // 1 | |
| // 2 | |
| // 3 | |
| // 4 |