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
// the M is the problem. | |
var tomas = ([!![]]+[])[+[]]+([]+{})[+!![]]+((+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!+[]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!+[]+[])[+[]]+(!+[]+[])[!+[]+!+[]+!+[]]+(!+[]+[])[+!+[]]])[+!+[]+[+[]]]+(!+[]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(![]+[])[+!![]]+(![]+[])[-~-~+!![]]; | |
// ta-da | |
console.log(tomas); |
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
String.prototype.splitAll = function(){ | |
var i = arguments.length, | |
original = this, | |
str = arguments[--i]; | |
for( ; str ; ){ | |
original = original.split(str); | |
(str = arguments[--i]) && (original = original.join(str)); | |
} | |
return original; | |
} |
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
#!/bin/bash | |
if [[ "$1" == "-h" || "$1" == "--help" ]]; then cat <<HELP | |
Chromium Updater | |
http://benalman.com/ | |
Usage: $(basename "$0") [revision] | |
Download and install the latest Chromium and dev tools, modifying the binary | |
to use those custom dev tools (downloaded into ~/.dotfiles/caches/chromium). |
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
@@ -339,6 +339,12 @@ var Cufon = (function() { | |
return glyphs; | |
})(data.glyphs); | |
+ this.missingGlyphs = ''; | |
+ for (var i in this.glyphs) { | |
+ this.missingGlyphs += i; | |
+ } | |
+ this.missingGlyphsRegexp = new RegExp("[^" + this.missingGlyphs.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") + "]"); | |
+ |
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
/** | |
* Long version | |
*/ | |
var isLeap = function(year) { | |
return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0); | |
}; | |
var getAge = function(birthDate) { | |
var now = new Date(), | |
age = 0, | |
// days since the birthdate |
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
var levenshtein = function(str1, str2) { | |
str1 = str1.split(""); | |
str2 = str2.split(""); | |
var distance = [], | |
l = str1.length, | |
m = str2.length, | |
i, j; | |
for( i = 0; i <= l; i++ ) { |
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
/** | |
* @type void as per Array#sort | |
* @see http://jsfiddle.net/tomasdev/ns2wj/ | |
*/ | |
/** @version 1 */ | |
Array.prototype.psort=function(p){p&&this.sort(function(a,b){return(a[p]<b[p]?-1:a[p]>b[p])})}; | |
/** @version 2 */ | |
Array.prototype.psort=function(p,g,u){p&&this.sort(function(a,b){return +((typeof a[p]===u+"")?!g:((typeof b[p]===u+"")?g:((a[p]<b[p])?-1:(a[p]>b[p]))))})}; |
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
// geo-location shim | |
// currentely only serves lat/long | |
// depends on jQuery | |
// doublecheck the ClientLocation results because it may returning null results | |
;(function(geolocation){ | |
if (geolocation) return; |
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
/** | |
* Relative time converter | |
* FIXME: fix hardcoded strings (ago, just now) | |
* @param {Date} dateObj Date object to convert to string | |
* @return {String} | |
*/ | |
var relativeTime = function(dateObj) { | |
var delta = new Date() - dateObj; | |
now_threshold = 5000; | |
if (delta <= now_threshold) { |
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
<snippet> | |
<content><![CDATA[ | |
// $1 Resource | |
Route::get('$1s', array('as' => '$1s', | |
'uses' => '$1s@index')); | |
Route::get('$1s/(:any)', array('as' => '$1', | |
'uses' => '$1s@show')); | |
Route::get('$1s/new', array('as' => 'new_$1', | |
'uses' => '$1s@new')); | |
Route::get('$1s/(:any)/edit', array('as' => 'edit_$1', |
OlderNewer