Skip to content

Instantly share code, notes, and snippets.

// Increment the version number every time the version changes. I can't figure out how to
// break this out into its own const, see https://github.com/rust-lang/rust/issues/52393.
#[derive(Debug, Serialize, Deserialize)]
#[serde(tag = "schema_version")]
enum VersionedCheckListList {
#[serde(rename = "1")] // increment here
Current(CheckListList),
}
@wickedchicken
wickedchicken / gist:3983685
Created October 30, 2012 23:07
hellyeah/chillbro: shows diff between you and common ancestor of master
# `git merge-base HEAD master` will show you the common ancestor b/t you and master
alias hellyeah='git diff `git merge-base HEAD master`'
alias chillbro='git log --left-right --graph --cherry-pick --oneline `git merge-base HEAD master`..HEAD'
#!/usr/bin/env python
# coding=utf-8
""":o
A detailed description of :o.
"""
import optparse
@wickedchicken
wickedchicken / gist:1632460
Created January 18, 2012 11:05
node-syslog workaround for "'syslog' was not declared in this scope" bug
# on some linuxen (and presumably macs) the real syslog.h is in sys/
# node-waf doesn't like this very much
# first cd into your node_modules directory (created when you install npm packages)
cd node_modules/
# clone the node-syslog source
git clone https://github.com/schamane/node-syslog.git
# cd into node-syslog
@wickedchicken
wickedchicken / Gemfile
Created December 6, 2011 20:01
sample EY Metrics application
source "http://rubygems.org"
gem "sinatra", "1.2.6", :require => "sinatra/base"
gem "thin", "1.2.7"
gem 'ey_config'
gem 'rest-client'
# vim: filetype=ruby
@wickedchicken
wickedchicken / gist:1432226
Created December 5, 2011 03:51
showmethemoney: gives you a nice git graph
# dredged from the depths of the internet
alias showmethemoney='git log --graph --full-history --all --color --date=short --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%ad %s"'
@wickedchicken
wickedchicken / gist:1325715
Created October 30, 2011 08:44
Enable all rfkill interfaces
# note: this is a terrible solution! bluetooth and such will be turned on automatically!
for i in /sys/class/rfkill/rfkill*/state; do echo 1 > $i; done
@wickedchicken
wickedchicken / app.rb
Created October 6, 2011 01:03
Sample Sinatra app to periodically submit hit data to metrics
# example code to submit data to the Librato Metrics API
# this is a small sinatra web application that keeps track of how many times
# the main page has been hit. when desired, the user can submit that data to metrics
# for more info visit http://dev.librato.com/
# 1.8.x compatibility
require 'rubygems'
@wickedchicken
wickedchicken / gist:1263236
Created October 5, 2011 00:19
Sample code to submit data to Librato Metrics
# example code to submit data to the Librato Metrics API
# for more info visit http://dev.librato.com/
require 'rubygems'
require 'rest-client'
require 'json'
# these are automatically set by the Heroku add-on
# if you already have a username and token, place them here
user = ENV["LIBRATO_METRICS_USER"]