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
/* | |
* HTML Highlighter | |
*/ | |
(function($){ | |
$.fn.highlight = function(words, options){ | |
var elements = $(this) | |
, settings = { | |
className: 'highlight' | |
, caseSensitive: false | |
} |
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
Date.prototype.toLocalISOString = function(){ | |
// ISO 8601 | |
var d = this | |
, pad = function (n){return n<10 ? '0'+n : n} | |
, tz = d.getTimezoneOffset() //mins | |
, tzs = (tz>0?"-":"+") + pad(parseInt(tz/60)) | |
if (tz%60 != 0) | |
tzs += pad(tz%60) | |
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
/* | |
* returns [{opts}, [args]] | |
*/ | |
var optParse = function(argv){ | |
var opts = {} | |
, args = [] | |
for(var i in argv){ | |
var x = argv[i] | |
if (x[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
It would be nice to have a browser native delay function that added | |
a function to the call stack to be run immediately, but not blocking | |
UI, similar to | |
> setTimeout(func, 0). | |
Currently prototype does this - prototype.function.defer sets a | |
timeout of 0.01. | |
In my experience though, setting a timeout has a delay - Resig's |
NewerOlder