Skip to content

Instantly share code, notes, and snippets.

View captainill's full-sized avatar

Jonathan Thomas captainill

View GitHub Profile
@captainill
captainill / app.js
Created June 10, 2012 04:41 — forked from elranu/app.js
Socket.IO RedisStore and Rooms
//app.js Socket IO Test
var app = require('express').createServer(),
redis = require('socket.io/node_modules/redis'),
io = require('socket.io').listen(app);
var pub = redis.createClient(port, "url");
var sub = redis.createClient(port, "url");
var store = redis.createClient(port, "url");
pub.auth('pass', function(){console.log("adentro! pub")});
sub.auth('pass', function(){console.log("adentro! sub")});
@captainill
captainill / DS prehack
Created May 24, 2011 20:05
DS prehack
if(!parent.window.prRefs){parent.window.prRefs={};};parent.window.prSet=function (n,v){if((typeof(n)!='undefined')&&(typeof(v)!='undefined')){parent.window.prRefs[n]=v;}};parent.window.prGet=function (n){if(typeof(parent.window.prRefs[n])!='undefined'){return parent.window.prRefs[n];}else{return null;}};
@captainill
captainill / Null PR CSS
Created May 24, 2011 19:31
Get rid of PR styles
prPost=function(){
document.getElementById("prf$_PR_SHORTIMPRESSIONID_REPLACE_$").className = ""
}
@captainill
captainill / Remove .svn
Created April 16, 2011 21:41
removes all files in a directory named .svn
http://codesnippets.joyent.com/posts/show/104
That isn't the best way to do it. It will break if you have lots of .svn directories. Then the command line will be too long and you will get 'argument list too long'. Recent bash have enormous buffers so this is less of a problem. xargs solves this problem.
The other problem is any file with spaces in the name will cause bash to treat it as two arguments. Which could give an error or could delete the wrong file. find -print0 and xargs -0 solve this problem.
find . -name .svn -print0 | xargs -0 rm -rf
The other way is to do: