Skip to content

Instantly share code, notes, and snippets.

View bortels's full-sized avatar

Tom Bortels bortels

  • Simi Valley, CA, USA
View GitHub Profile
@bortels
bortels / chrome-cache-recovery.js
Last active September 19, 2015 20:19 — forked from whatnickcodes/chrome-cache-recovery.js
Quick and dirty script to recover images from chrome cache. Just paste this into your console to automatically download all Scotch.io cached images
// Open chrome://cache/ and paste the following script in the console. Feel free to edit the filter variable
var filter = /cask\.scotch\.io(.)*\.(jpg|jpeg|png|gif)/g;
/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);retu
There's a bug in the "Gravity" example for Codify (as of Oct 27, 2011) - the arrowhead doesn't point the right direction in the upper left quadrant.
To fix:
Change line 34 to:
down = vec2(1,0)
And change lines 44-45 to:
@bortels
bortels / gist:1325166
Created October 29, 2011 22:20
messing with custom spritepack in Codify
watch("t")
watch("r")
watch("s")
watch("aa")
-- Use this function to perform your initial setup
function setup()
origin = vec2(1,0)
w2 = WIDTH/2
h2 = HEIGHT/2
@bortels
bortels / bgr.pl
Created October 29, 2011 22:43
Use ImageMagick to convert PNG background to transparent alpha
#!/usr/bin/perl
$img = shift @ARGV;
$corner = `convert $img -format '%[pixel:s.p{0,0}]' info:`;
chomp $corner;
print "corner color is $corner\n";
@r = split(/\./, $img);
$ext = pop @r;
$name = join('.', @r); $name = $name . "_new." . $ext;
print "Saving to $name\n";
@bortels
bortels / simplexfont.lua
Created October 31, 2011 17:13
Data for the Hershey Simplex font
function drawchar(c, ox, oy)
ax=-1
ay=-1
bx=-1
by=-1
stroke(255,0,21,255)
strokewidth(3)
ch = font[c]
for p=1, ch.points do
ax=bx
@bortels
bortels / Main.lua
Created November 1, 2011 17:26
Hershey Roman Simplex font using packed data for Codea
-- This works, but is obsolete - go to https://github.com/bortels/HersheyCodea for the newest version
-- Just a "Main" tab for Codea to demo the class
function setup()
   f=Font()
   f:init()
   frame=1
   offset = 0
   stroke_width=2
@bortels
bortels / starfield.js
Created November 7, 2011 06:06
Javascript Starfield
function StarField(canvas_id, width, height, num_stars) {
var width = width ? width : 3000,
height = height ? height : 1500,
origin_x = width / 2,
origin_y = height / 2,
stars = [],
num_stars = num_stars ? num_stars : 80,
canvas_id = canvas_id;
function create_star() {
@bortels
bortels / convert.pl
Created November 22, 2011 17:43
convert font data for codify
#!/usr/bin/perl
# This is ugly - I disavow all knowledge of it's existence. It was a one-off, so there are NO
# attempts to make it clean or understandable. HERE THERE BE DRAGONS.
use MIME::Base64;
#font = {
# " " = { name="space", symbol=" ", width=16, ascii=32,
# data={} }
@bortels
bortels / gist:1388116
Created November 23, 2011 07:34
Keyboard for Codea
Keyboard = class()
function Keyboard:init()
self.keyinfo = {
one = { chr="1", glyph="1", schr="!", sglyph="!", row=4, col=2 },
two = { chr="2", glyph="2", schr="@", sglyph="@", row=4, col=3 },
three = { chr="3", glyph="3", schr="#", sglyph="#", row=4, col=4 },
four = { chr="4", glyph="4", schr="$", sglyph="$", row=4, col=5 },
five = { chr="5", glyph="5", schr="%", sglyph="%", row=4, col=6 },
six= { chr="6", glyph="6", schr="^", sglyph="^", row=4, col=7 },
@bortels
bortels / tom.uu
Created December 6, 2011 18:27
uuencoded pnm of tomfezicon
begin 644 tom.pnm
M4#8*-C0@-C0*,C4U"@P3&28]0Q9!2``Q.`4P.0`5(A(;+`8'&0\-&Q,0&1@6
M&R$>)2@G-1$:*R$Y10\P.2$9+BD7+1T+(146*`DD-0`C/P,=0@H9.@L6*!8@
M*4A15DM55S9"0@$0#0D1%`T-&2DB*@T*$187&Q$6&08+#@D-$`D-$`D,$189
M(!L>)2`C+!P?*!T@)Q$9'`\9&Q8B(AHA*QX@+!T@*1D=(!PB(BHN,3Y!2$U2
M5E!96%5;6UQ;85U;8%I<655<5%5;5U58720I+3U,4R`[1`HL-00E+@08(P\6
M)@D(&`L+%QL:(!43&!T:(Q06(Q`<*B(X11$N-BD5+C$9,R$*)!H;+P8A-``C
M/0`>00`9-P89*A,A*DA26TU47#I"10T5%Q$1&1<.'R@G+0X-$Q85&B@I+0T.
M$A(1%A(0%1`/%1H=)`<.%`<0%PD0%@P1%Q07'!@=(1<?(1DB*1D@*AD=)APD
M)Q@B(Q8=(QD@*!XE*RTV-4I04%M:7U]=8E-55$U33TE244E06#M!04-(3D)*