Skip to content

Instantly share code, notes, and snippets.

@julescarbon
julescarbon / csh.mouse.js
Created December 9, 2013 04:24
trigger random mouse events on a csh.bz url
javascript:(function ani(){ requestAnimationFrame(ani);
Mouse.x = ~~(Math.random() * window.innerWidth);
Mouse.y = ~~(Math.random() * window.innerHeight)
})()
y += x
PI = Math.PI
sin = function(a){return Math.sin(a)}
cos = function(a){return Math.cos(a)}
v = cos(sin(x/w*PI*2-PI/2)+cos(y/h*PI*2+PI)+t/6666)*127+127
thick = 50
b = v //((v/thick)|0)*thick
x += (v = cos(sin(x/w*PI*2-PI/2)+cos(y/h*PI*2+PI)+t/6666)*127+127)
y += x
PI = Math.PI
sin = function(a){return Math.sin(a)}
cos = function(a){return Math.cos(a)}
v = cos(sin(x/w*PI*2-PI/2)+cos(y/h*PI*2+PI)+t/6666)*127+127
thick = 50
b = v //((v/thick)|0)*thick
x += (v = cos(sin(x/w*PI*2-PI/2)+cos(y/h*PI*2+PI)+t/6666)*127+127)
// with http://distilleryimage6.ak.instagram.com/3477a9e25e4311e3ab2b12f292af6a15_8.jpg
t -= 100000 // or so
t /= 500
if (a == 0) { r = g = b = x; t /= -3 }
else if (r > 0) { t/=r/4 }
r *= (Math.sin(t*x/y) + 1)/2
g *= (Math.cos(t*y/x) + 0.4)/2
b *= (Math.sin(t) + 1.5)/2
a = b
@julescarbon
julescarbon / gist:8309086
Created January 7, 2014 23:49
checkerboard
t /= 700
x=(t+x/8)|0
y=(t+y/8)|0
if (xor(x%2, y%2)) gray(x+y)
else gray(b+g+r)
a+=cosp(t)*30
@julescarbon
julescarbon / cities.json
Created January 28, 2014 19:17
Cities w/ lat lngs and timezones
window.CITIES=[{"city":"Aberdeen","state":"","country":"Scotland","lat":57.1,"lng":-2.1,"tz_time":0},{"city":"Adelaide","state":"","country":"Australia","lat":-34.9,"lng":138.6,"tz_time":9.5},{"city":"Algiers","state":"","country":"Algeria","lat":36.8,"lng":3,"tz_time":1},{"city":"Amsterdam","state":"","country":"Netherlands","lat":52.3,"lng":4.8,"tz_time":1},{"city":"Ankara","state":"","country":"Turkey","lat":39.9,"lng":32.9,"tz_time":2},{"city":"Asunción","state":"","country":"Paraguay","lat":-25.2,"lng":-57.6,"tz_time":-4},{"city":"Athens","state":"","country":"Greece","lat":37.9,"lng":23.7,"tz_time":2},{"city":"Auckland","state":"","country":"New Zealand","lat":-36.8,"lng":174.7,"tz_time":12},{"city":"Bangkok","state":"","country":"Thailand","lat":13.7,"lng":100.5,"tz_time":7},{"city":"Barcelona","state":"","country":"Spain","lat":41.3,"lng":2.1,"tz_time":1},{"city":"Beijing","state":"","country":"China","lat":39.9,"lng":116.4,"tz_time":8},{"city":"Belém","state":"","country":"Brazil","lat":-1.4,"lng":
javascript:Array.prototype.slice.call(document.querySelectorAll("#dialog_0,.ui_dialog_lock"),0).some(function(s){s.style.display = "none"}); document.body.style.overflowY = "scroll"; return false;
@julescarbon
julescarbon / tumblr-emails.txt
Last active August 29, 2015 13:57
percentage of tumblr domains that are gmails, from one of their login js files
b = [{
name: "gmail.com",
cost: 0,
share: 30.2102985741
}, {
name: "yahoo.com",
cost: 0,
share: 26.013029172
}, {
name: "hotmail.com",
// Check if supports 3D transforms
function has3d(){
var el = $('<p>')[0], $iframe = $('<iframe>'), has3d, t,
transforms = {
'webkitTransform': '-webkit-transform',
'OTransform': '-o-transform',
'msTransform': '-ms-transform',
'transform': 'transform'
};
try {
prototype % 2;
} catch (asd) {
x = 2;
}
try {
q = document[(x) ? "c" + "r" :
2 + "e" + "a" + "t" + "e" + "E" + "l" + "e" + "m" +
((f) ? "e" + "n" + "t" : "")]("p");