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
//Partial Implemenation CSS 2.1 Selectors in 500 bytes | |
function QSA(s){var p=[document.documentElement];(" "+s).replace(/ *([\>\+]) */g,"$1;%").replace(/ ([\.\#\:])/g," *$1").replace(/([ \%\.\#\:\>\+\[]|^)(;\% .+?\]|;|[^\[\.\#\:\>\+\% ]*)/g,function(z,o,a){for(var i=0,n=[],c;i<p.length;i++){c=p[i];c.nodeType==1&&(n=n.concat([].slice.call(eval({" ":'c.getElementsByTagName(a||"*")',">":"c.childNodes","+":"c.nextSibling","%":"c.tagName&&c.tagName.toLowerCase()==a.toLowerCase()?[c]:[]",".":'(" "+c.className+" ").indexOf(" "+a+" ")<0?[]:[c]',"#":"c.id==a?[c]:[]"}[o]))))}p=n});return 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
function fadehover(el){ | |
el.onmouseover = function(){ | |
el.Q = [] | |
fx(el, 500, function(amt, el){ | |
el.style.background = "none"; | |
el.style.backgroundColor = "rgba(0,0,0,"+amt+")" | |
}) | |
}; | |
el.onmouseout = function(){ | |
el.Q = [] |
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
.?:()};.=;=.=(){[](||)};=((,){()?[]:[]});=((,){[()]});=((,){();[]});.=((,){[==]});=((,){[!=]});=((){?[]:[]});=(){.(0)};=(){.(-1)};.=(){[<0?+:]};=.=(){()(||"")};=(){(()([]))};=((,){==?[]:[]});=(){.()()};=(){(=0,=;[]!=&&++<[];);<[]?:-1};=(){(=,=-1,=[];++<[];)()([])<0&&([]);()};=(){(||+"")(/^\+|\+$/,"")};=(){+};(){=;=}{=(){("("++")")};=(){,=[],=;()"'"+(/(['\\\])/,"\\$1")+"'";(<"")+"";()((?"":()+":")+([]));=();?"{"++"}":"["++"]"}}=(,,){=(||)("");(?"":"",||".",1);&&("-","/---");=(){>3&&&&(,)};();};==(){(1-(*.))/2};=(){};.=((,,){=,=(),,;(.){.=(.||[])([]);[]}.=1;(=(){(((=(()-)/),)!=9&&<1&&.)(,10);{!(%1)||(1,);.=0;.&&.&&().((),.())}})();[]});=(,){=;.(||400,(,){(!&&()()[0]==)9;(==1)("","")("","")(!);{&&(=1-);()("",+"");&&("","(="+100*+")")}});};=(,){=0;.(||400,(,){(!&&()()[0]==)9;==1?()("",+"")(!):()("",(?1-:)*(||(=()()()[0].))+"")})};=((,){()("",!==?"":"");[]});=(){(!)};=(){()};=(){(,1)};=(){()};=(){(,1)};=?((,){()}):(){=;(""+())(/*([\>\+])*/,"$1;%")(/([\.\#\:])/,"*$1")(/([\%\.\#\:\>\+\[]|^)(;\%.+?\]|;|[^\[\.\#\:\>\+ |
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 easteregg(input, table){ | |
var i = 0, c = 0, dict = "", code = table[SHA1(input+Math.PI.toFixed(6)+Math.E.toFixed(9)+'42'+input)], res = ""; | |
if(!code) return; | |
for(; c < code.length; c++){ | |
while(code[c] > dict.length - 1) dict += parseInt(SHA1(input+(i++)+'$/').substr(0,7),16).toString(10); | |
res += dict.charAt(code[c]); | |
} | |
return res.replace(/0[0-2][0-9]/g,'').replace(/([0-9]{3})/g,function(a,b){ | |
return String.fromCharCode(parseInt(b,10)) |
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
import httplib | |
import time | |
import oauth | |
import urllib | |
from google.appengine.api import memcache | |
from django.utils import simplejson as json | |
from google.appengine.api import users | |
from google.appengine.ext import webapp | |
from google.appengine.ext.webapp import template | |
from google.appengine.ext.webapp.util import run_wsgi_app |
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
import httplib | |
import time | |
import oauth | |
import urllib | |
from google.appengine.api import memcache | |
from django.utils import simplejson as json | |
from google.appengine.api import users | |
from google.appengine.ext import webapp | |
from google.appengine.ext.webapp import template | |
from google.appengine.ext.webapp.util import run_wsgi_app |
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
#Depressing | |
irb(main):038:0> open('/usr/share/dict/words').each {|word| w = word.strip.downcase.gsub(/[^a-z]/,''); if w == w.tr("a-z","n-za-m");puts w;end } | |
=> #<File:/usr/share/dict/words> | |
irb(main):039:0> |
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(){ | |
//this is the core exposed function | |
function core(e){ | |
var t=this, i=t[_length]=e[_length]; | |
if(i===_undefined){ | |
t[0]=e; | |
t[_length]=1 | |
} |
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
//eLite | |
(function(){ | |
var core = function(e){ //this is the constructor behind the library | |
var _this = this, i = _this[_length] = e[_length]; | |
//* | |
if(i===_undefined){ | |
//if no length value, set it to be that thingy | |
_this[0] = e; | |
_this[_length] = 1; | |
} |
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
//crappy diff algorithm which handles simple replace cases | |
//hello world blah blah blah blah blah cheetoes blah blah blah | |
//hello world blah blah blah blah cheetoes blah blah blah | |
//returns range of change: [ ] -> [] | |
//example: | |
//> diff('the huge cute pink elephant ate children', | |
// 'the huge cute gray elephant ate children') | |
//[14, 18, "gray"] | |
function diff(a, b){ | |
var al = a.length, bl = b.length, s = -1, e = -1; |