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
| 0xeb0fa78cfe43d30a61de0aacea86452ae537fe3a |
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
| $.wait = function(time) { | |
| var id; | |
| var def = $.Deferred(function(dfd) { | |
| id = setTimeout(dfd.resolve, time); | |
| }); | |
| def.cancel = function() { | |
| clearTimeout(id); | |
| def.reject(); | |
| } | |
| return def; |
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
| /** | |
| * The first commented line is your dabblet’s title | |
| */ | |
| html { | |
| font-family: Helvetica; | |
| background: #f06; | |
| background: linear-gradient(23deg, #f06, yellow); | |
| min-height: 100%; | |
| } |
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
| /** | |
| * The first commented line is your dabblet’s title | |
| */ | |
| html { | |
| font-family: Helvetica; | |
| background: #f06; | |
| background: linear-gradient(23deg, #f06, yellow); | |
| min-height: 100%; | |
| } |
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
| // see http://mistakes.io/#5714973 with console visible | |
| require('https://raw.github.com/dtao/lazy.js/master/lazy.min.js'); | |
| require('http://documentcloud.github.io/underscore/underscore-min.js'); | |
| var n = 10; | |
| var log = function(msg) { console.log(msg) }, | |
| done = function() { log('DONE') }, | |
| doneAfterN = _.after(n, 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
| base64 /path/to/image.png | pbcopy |
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
| // adapted www.jameswiseman.com/blog/2010/08/24/manually-traverse-a-dom-tree-using-jquery/ | |
| // requires jquery | |
| function html2less($item, pass) { | |
| var tmp = {}; | |
| $item = $item ? $item : $('body'); | |
| pass = pass ? pass : { max: 50, count: 0, less: "" }; | |
| $item.each(function(n, v) { |
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
| <script>!window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.5.0.js"%3E%3C/script%3E'))</script> |
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
| // old and busted - don't do this | |
| setInterval(function(){ | |
| $.ajax({ | |
| url: 'foo.htm', | |
| success: function( response ){ | |
| // do something with the response | |
| } | |
| }); | |
| }, 5000); | |
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 (window.location.hostname == 'localhost') { | |
| var l = document.getElementById('main_styles'); | |
| l.rel = 'stylesheet/less'; | |
| l.href = 'less/main.less'; | |
| } |
NewerOlder