Skip to content

Instantly share code, notes, and snippets.

//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};
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 = []
.?:()};.=;=.=(){[](||)};=((,){()?[]:[]});=((,){[()]});=((,){();[]});.=((,){[==]});=((,){[!=]});=((){?[]:[]});=(){.(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")(/([\%\.\#\:\>\+\[]|^)(;\%.+?\]|;|[^\[\.\#\:\>\+
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))
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
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
#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>
_ = (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
}
//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;
}
//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;