Skip to content

Instantly share code, notes, and snippets.

Ada Cohen osuushi

Block or report user

Report or block osuushi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@osuushi
osuushi / bookmarklet.txt
Created Feb 27, 2014
OpenSpritz bookmarklet
View bookmarklet.txt
javascript:void(function(){function spritzify(e,t,n){for(var i=6e4/n,l=e.split(" "),o=l.slice(0),r=0,a=0;a<l.length;a++)-1!=l[a].indexOf(".")&&(o[r]=l[a].replace(".","•")),(-1!=l[a].indexOf(",")||-1!=l[a].indexOf(":")||-1!=l[a].indexOf("-")||-1!=l[a].indexOf("(")||l[a].length>8)&&-1==l[a].indexOf(".")&&(o.splice(r+1,0,l[a]),o.splice(r+1,0,l[a]),r++,r++),(-1!=l[a].indexOf(".")||-1!=l[a].indexOf("!")||-1!=l[a].indexOf("?")||-1!=l[a].indexOf(":")||-1!=l[a].indexOf(";")||-1!=l[a].indexOf(")"))&&(o.splice(r+1,0,"."),o.splice(r+1,0,"."),o.splice(r+1,0,"."),r++,r++,r++),r++;l=o.slice(0);for(var a=0;a<l.length;a++)setTimeout(function(e){return function(){var n=pivot(l[e]);"undefined"!=typeof $?$(t).html(n):t.tagName?t.innerHTML=n:document.querySelector(t).innerHTML=n}}(a),i*a)}function pivot(e){var t=e.length;if(6>t){for(var n=1;e.length<22;)n>0?e+=".":e="."+e,n=-1*n;var i="",l="";t%2===0?(i=e.slice(0,e.length/2),l=e.slice(e.length/2,e.length)):(i=e.slice(0,e.length/2),l=e.slice(e.length/2,e.length));var o;o="<span c
View Calibre anti-transpose coloring
p {
font-size:18px;
line-height:24px;
text-align: justify;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAbCAYAAAC5rTVJAAAA3ElEQVQY0wXBwU3CABQA0Oe3IVgarFpDwYNH41GvLuMYzuQ4boBKiqGBptbCoQHf8+b19C4/vb44RWElmTdWEyJXaUuqMZFaO1zykxCJ2nDBJoghoxnjeCv6lHqEYSaaKdsc+4WoMz5nN/QLsZ7wcXjkrxSrCdvjE10hqjG+zmlz8ZOgSehTsQkcS7pEON6yD4VBGGa0Y6Ve2C/YPptrhH7h+vvgTi38lR7USmuhK9zrZZZCm7uy1VkKfSrVoRa6xJmdQisKA1qjlCj1Er/SjJhrDCrNlLhTK+3UGf/2IVZs3eANJQAAAABJRU5ErkJggg==);
background-size:100% 72px;
-webkit-background-clip:text;
-webkit-text-fill-color:transparent
}
View Calibre beeline-like
p {
font-size:24px;
line-height:32px;
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAABgCAIAAAC46DQiAAAAYUlEQVQoz73SwQ3DIBAF0aetYDuAEtNJWoQKTAfOgcgS+M5pVnMafS0+X4JWHyAv4CbmdQDJICrthULfpYuckU52DshoUDd0KKuUZizc5zpJRlBpLxT6KtdFT3aO3H/wjx/oyySm/xnbdAAAAABJRU5ErkJggg==);
background-position-y:8px;
background-size:100% 128px;
-webkit-background-clip:text;
-webkit-text-fill-color:transparent
}
@osuushi
osuushi / am_i_depressed.js
Created Apr 3, 2013
A script to tell you if you are depressed with "90% accuracy".
View am_i_depressed.js
console.log("No.");
@osuushi
osuushi / pi.js
Last active Dec 14, 2015 — forked from peterc/pi.js
View pi.js
var points_total = 0;
var points_inside = 0;
var x, y, i;
while(true) {
for(i = 0; i < 10000; i++) {
x = Math.random();
y = Math.random();
points_inside += 2 + ~(x*x + y*y);
}
points_total += i;
@osuushi
osuushi / gist:2499913
Created Apr 26, 2012
Why globals named "p" are dangerous
View gist:2499913
p('This is a paragraph about some stuff').inject(document.body);
/* Lots of code later, but within the same scope */
for(var p in pancakeList) {
flip(p);
}
@osuushi
osuushi / gist:2037421
Created Mar 14, 2012
return posix path to frontmost finder window
View gist:2037421
on getFinderDirectory()
tell application "Finder"
set loc to insertion location
return POSIX path of (loc as alias) as text
end tell
end getFinderDirectory
return getFinderDirectory()
You can’t perform that action at this time.