Skip to content

Instantly share code, notes, and snippets.

View captainill's full-sized avatar

Jonathan Thomas captainill

View GitHub Profile
@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:
@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 / 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 / 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 / Git list files changed in commit by name
Created December 5, 2013 22:24
Git list files changed in commit by name
git diff-tree --no-commit-id --name-only -r 0699061
@captainill
captainill / bundle install issue
Created February 25, 2014 01:12
bundle install issue
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/vagrant/.rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb
Command 'qmake -spec linux-g++ ' not available
Makefile not found
Gem files will remain installed in /home/vagrant/.rvm/gems/ruby-2.0.0-p451/gems/capybara-webkit-1.1.1 for inspection.
Results logged to /home/vagrant/.rvm/gems/ruby-2.0.0-p451/extensions/x86_64-linux/2.0.0/capybara-webkit-1.1.1/gem_make.out
An error occurred while installing capybara-webkit (1.1.1), and Bundler cannot continue.
@captainill
captainill / forego start output
Created February 25, 2014 01:15
forego start output
forego | starting web on port 5000
forego | starting worker on port 5100
web | Your Gemfile lists the gem pg (~> 0.17.0) more than once.
web | You should probably keep only one of them.
web | While it's not a problem now, it could cause errors if you change the version of just one of them later.
worker | Your Gemfile lists the gem pg (~> 0.17.0) more than once.
worker | You should probably keep only one of them.
worker | While it's not a problem now, it could cause errors if you change the version of just one of them later.
web | bin/web: line 6: unicorn: command not found
forego | shutting down

How to Post to a Google Spreadsheet

Part 1 - Setting up the Google Document

  • Go to Google Docs and create your spreadsheet
  • Give column names and make note of them as they become the names of your input fields
  • Give the spreadsheet the tab name of "DATA"
  • Click Tools > Script Editor
  • Choose 'Spreadsheet' under 'Create Script for'
/** @jsx React.DOM */
/* jshint trailing:false, quotmark:false, newcap:false */
define(function (require) {
'use strict';
var React = require('react'),
Promise = require('bluebird'),
$ = require('jquery');
define(function () {
'use strict';
var _ = require('underscore');
var ValidationMixin = {
getInitialState: function () {
return {
errors: []