Skip to content

Instantly share code, notes, and snippets.

View matschaffer's full-sized avatar
🧡

Mat Schaffer matschaffer

🧡
View GitHub Profile
jar 'com.netflix.hystrix:hystrix-core', '~>1.2.16'
@matschaffer
matschaffer / agent.js
Last active December 14, 2015 05:59 — forked from eveiga/gist:5039007
/*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
matschaffer / gist:942981
Created April 26, 2011 19:52 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
$ 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
require 'csv'
def coordinates(addr)
include Geokit::Geocoders
res=MultiGeocoder.geocode(addr)
res.ll
end
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 {
Thread.sleep(5000);
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
seasons.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