Skip to content

Instantly share code, notes, and snippets.

ripped from http://meyerweb.com/eric/tools/dencoder/
This tool is provided without warranty, guarantee, or much in the way of explanation. Note that use of this tool may or may not crash your browser, lock up your machine, erase your hard drive, or e-mail those naughty pictures you hid in the Utilities folder to your mother. Don't blame me if anything bad happens to you, because it's actually the aliens' fault. The code expressed herein is solely that of the author, and he's none too swift with the JavaScript, if you know what we mean, so it's likely to cause giggle fits in anyone who knows what they're doing. Not a flying toy. Thank you for playing. Insert coin to continue.
@codeincontext
codeincontext / gist:4286311
Created December 14, 2012 15:36
ssh into the same directory on the server as your local working directory. If you're in /Users/skattyadz/Dropbox/code/instawall, it will ssh in and "cd instawall"
# add to ~/.bash_profile
function sshh() {
local PROJECTNAME=${PWD##*/}
local HOST=$1
eval "ssh -t ${HOST} \"cd ${PROJECTNAME}; bash\""
}
@codeincontext
codeincontext / gist:4286762
Created December 14, 2012 16:37
Make terminal text purple when ssh'ed into a server
# in remote ~/.bashrc
if [ -n "$SSH_CLIENT" ]; then text=" ssh"
fi
export PS1='\[\e[0;35m\]\u@\h:\w${text}$\[\e[m\] '
# - Colour codes -
# Black 0;30
@codeincontext
codeincontext / gist:4479523
Last active December 10, 2015 19:08
Simple counter node server (cache testing)
var http = require('http');
var number = 0;
http.createServer(function (req, res) {
if (req.url == '/') number++;
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end(number.toString());
}).listen(3000);
Reading symbols for shared libraries ++++......................................................................................................................................... done
Reading symbols for shared libraries . done
Reading symbols for shared libraries .warning: Could not find object file "/Users/skattyadz/Dropbox/code/node-canvas/pixman-0.28.0/pixman/.libs/pixman.o" - no debug information available for "pixman.c".
warning: Could not find object file "/Users/skattyadz/Dropbox/code/node-canvas/pixman-0.28.0/pixman/.libs/pixman-access.o" - no debug information available for "pixman-access.c".
warning: Could not find object file "/Users/skattyadz/Dropbox/code/node-canvas/pixman-0.28.0/pixman/.libs/pixman-access-accessors.o" - no debug information available for "pixman-access-accessors.c".
warning: Could not find object file "/Users/skattyadz/Dropbox/code/node-canvas/pixman-0.28.0/pixman/.libs/pixman-bits-image.o" - no debug information available for "pixman-bits-image.c".
@codeincontext
codeincontext / gist:4731825
Last active December 12, 2015 06:49
SEGFAULT 11
var Canvas = require('canvas')
, Image = Canvas.Image
, canvas = new Canvas(400, 400)
, ctx = canvas.getContext('2d')
, fs = require('fs')
var sprite
var hairSprite
@codeincontext
codeincontext / gist:4731892
Created February 7, 2013 15:59
No segfault
var Canvas = require('canvas')
, Image = Canvas.Image
, canvas = new Canvas(400, 400)
, ctx = canvas.getContext('2d')
, fs = require('fs')
var sprite
var hairSprite
@codeincontext
codeincontext / gist:4732237
Created February 7, 2013 16:40
Running the same JS on client and server
var serverSide = (typeof module !== "undefined");
if (serverSide) {
var Canvas = require('canvas')
, Image = Canvas.Image
, fs = require('fs');
}
function HeroImage() {
var height = 620;
new Crafty.polygon([379,562],[772,560],[785,547],[783,531],[381,531],[379,543]),
new Crafty.polygon([186,526],[293,522],[297,556],[186,561],[175,544]),
new Crafty.polygon([817,362],[805,385],[781,403],[751,418],[712,421],[696,318],[749,307],[777,321],[806,338]),
new Crafty.polygon([219,189],[796,189],[807,197],[809,208],[802,221],[787,230],[218,224],[206,215],[206,205]),
new Crafty.polygon([635,550],[713,457],[781,520],[784,543],[778,556]),
new Crafty.polygon([709,412],[709,479],[731,480],[731,412]),
new Crafty.polygon([620,226],[699,294],[785,218]),
new Crafty.polygon([679,280],[704,347],[749,327],[722,263]),
new Crafty.polygon([91,55],[997,52],[997,14],[95,25]),
new Crafty.polygon([261,688],[935,688],[934,726],[262,718]),
- (void)onTapped:(UITapGestureRecognizer*)gesture {
self.currentPage = (self.currentPage+1) % self.numberOfPages;
[self setNeedsDisplay];
[self sendActionsForControlEvents:UIControlEventValueChanged];
}