Skip to content

Instantly share code, notes, and snippets.

@tmcw
tmcw / disconnect.rb
Created July 22, 2011 04:06
bulk-export run data from Garmin Connect
#!/usr/bin/env ruby
## disconnect
# ./disconnect.rb -u yourusername
#
# This is a command-line utility for the bulk-downloading of run data from
# the connect.garmin.com web application, which has lackluster export
# capabilities.
#
@dysinger
dysinger / bootstrap.sh
Created May 13, 2011 08:27
vagrant/ec2 boostrap script
#!/bin/bash -ex
if [ ! -f /usr/bin/chef-solo ]; then
apt-get update
apt-get -y upgrade
@pepijndevos
pepijndevos / lazy_sort.clj
Created May 2, 2011 12:49
Lazy sorting implementations in Clojure
(ns lazy-sort)
(defn qsort [[head & tail]]
(when head
(lazy-cat (qsort (filter #(< % head) tail))
[head]
(qsort (remove #(< % head) tail)))))
(defn merge*
[[f1 & r1 :as l1] [f2 & r2 :as l2]]
@jasonroelofs
jasonroelofs / setup-statsd.sh
Created April 27, 2011 18:25 — forked from collegeman/setup-statsd.sh
Turn an Ubuntu 10.10 EC2 into a StatsD/Graphite server
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# download the Node source, compile and install it
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
# install the Node package manager for later use
@cchandler
cchandler / gist:939951
Created April 24, 2011 22:55
glpk model for cloud vs colo costs
#Colo Server costs
set ServerTypes;
set InstanceTypes;
param CoreDemand; #How many cores do we need for a workload
param OurMoney; #The maximum upper-bound of what we're willing to spend
param ColoCostPerU; #How much are we paying per U of colocation
param Months; # How many months do we know we need this hardware
@cowboyd
cowboyd / JenknsCI JRuby Meeting Details.mdown
Created March 28, 2011 14:28
Meeting Details for Jenkins + JRuby

JenkinsCI Ruby Plugins

Date: Every Thursday, from Thursday, January 5, 2012 to no end date Time: 10:00 am, Central Standard Time (Chicago, GMT-06:00) Meeting Number: 336 439 792 Meeting Password: (This meeting does not require a password.)

@Chouser
Chouser / proxy-star.clj
Created March 15, 2011 21:22
Like clojure.core/proxy, but accepts a syntax like reify
(let [arrays '{objects "Ljava.lang.Object;",
ints I, longs J, floats F, doubles D, chars C,
shorts S, bytes B, booleans Z}]
(defn qualify-tag [tag]
(when tag
(let [cls (if-let [array (arrays tag)]
(clojure.lang.RT/classForName (str "[" array))
(resolve tag))]
(assert (class? cls))
(symbol (pr-str cls))))))
@dbrady
dbrady / change_case.el
Created February 28, 2011 01:02
emacs lisp defuns to change the case (camelCase <-> snake_case) of the word under cursor, or an entire region if selected. NOTE: the snake-case defuns do not work, they just camelCase. Ooops.
;; Grateful thanks are given to Brian Marick (@marick) for helping me
;; write these. I got the original idea while reading through
;; http://xahlee.org/emacs/elisp_idioms.html, but couldn't work out
;; the elisp regexes. Brian Marick (@marick) stepped in and helped. He
;; took my tortured and broken camelcase-region and turned it into
;; something that actually worked. I then created
;; camelcase-word-or-region. I then wrote the snakecase versions but I
;; see now that all I did was copy the camelcase defuns over and,
;; meaning to go back and finish them Real Soon Now, forgot all about
;; them. I've had a quick look (2011-02-27) but elisp regexes are
# I want this method in ruby-core
def let
yield
end
def fib(i)
let do |n = 1, result = 0|
if i == -1
result
else
# Install ZeroMQ
sudo brew install zmq
easy_install pyzmq
[0] http://www.zeromq.org/bindings:python
# Install OpenCV
sudo brew install opencv