View tracer.js
This file contains 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
/* tracer.js - A tracer utility in 2kb | |
* | |
* @author Angus Croll | |
* http://javascriptweblog.wordpress.com/2010/06/01/a-tracer-utility-in-2kb/ | |
*/ | |
String.prototype.times = function(count){ | |
return count < 1 ? '' : new Array(count + 1).join(this); | |
} |
View jquery.stretch.js
This file contains 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
/* | |
* jQuery Stretch Plugin | |
* http://sistersylvie.com/js_lab/stretchy/ | |
* Copyright (c) 2010 Tommy Hunke | |
* Version: 1.0 (05/23/2010) | |
* Licensed under the MIT licenses: | |
* http://www.opensource.org/licenses/mit-license.php | |
* Requires: jQuery v1.3 or later | |
*/ | |
;(function($){ |
View gist:1574561
This file contains 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 rossify(sentence){ | |
var re = /\w+/g, words = sentence.match(re); | |
return sentence.replace(re, function(){ | |
return words.pop(); | |
}); | |
} | |
// > rossify('hi, my name is aeron. today i am good!'); | |
// "good, am i today aeron. is name my hi!" |
View gist:4029623
This file contains 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
p = function(s, l) { return (l = ~~(s.length / 2)), s.substr(0, l).split('').reverse().join('') == s.substr(-~l) } |