Skip to content

Instantly share code, notes, and snippets.


Mat Schaffer matschaffer

View GitHub Profile
View Jarfile
jar '', '~>1.2.16'
View agent.js
/*jshint multistr:true */
var fs = require('fs'),
exec = require('child_process').exec,
path = require('path'),
os = require('os');
var Sentinel = require("node-sentinel"),
_ = require("underscore"),
async = require("async"),
nodemailer = require("nodemailer");
matschaffer / gist:942981
Created Apr 26, 2011 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
View gist:942981
$ git branch -r --merged |
sed '/>|master/d;/origin/!d;s:origin/::' |
xargs git push origin --delete
# I think this will work, but I don't know how to get git branch to show me that -> line
View blah.rb
require 'csv'
def coordinates(addr)
include Geokit::Geocoders
namespace :import do
desc 'Parse CSV files and import into the database'
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.SWT;
public class SWTMenuDispose {
public static void main(String[] args) throws InterruptedException {
View nested_class_associations.rb
class District
has_many :leagues
has_many :seasons, :through => :leagues
# If this doesn't work
has_many :teams, :through => :seasons
# How about this?
def teams
import commands
from string import Template
tmpl = Template("git-svn clone $repo $folder")
def getCommandOutput(command):
status, output = commands.getstatusoutput(command)
if status != 0:
raise RuntimeError, '%s failed w/ exit code %d' % (command, status)
return data