Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@joeshaw
joeshaw / gist:1efa84954539eb72d66f7520a4ca9569
Last active September 13, 2016 18:41
partial .gitconfig
[alias]
find = !sh -c 'git ls-files |grep --color=auto -i "$@" |less -FRSX' -
fixup = "!f() { TARGET=$(git rev-parse "$1"); git commit --fixup=$TARGET ${@:2} && EDITOR=true git rebase -i --autostash --autosquash $TARGET^; }; f"
squash = "!f() { TARGET=$(git rev-parse "$1"); git commit --squash=$TARGET ${@:2} && git rebase -i --autostash --autosquash $TARGET^; }; f"
ri = rebase --interactive --autosquash --autostash
lt = log --graph --pretty=changes
ll = log --numstat --pretty=changes
ds = diff --staged
ego = shortlog -s -n --no-merges
pr = pull-request
@joeshaw
joeshaw / addnicks.js
Created February 4, 2016 15:06
Display slack handles next to real names
function addNicks() {
$(".message_sender").map(function() {
var name = $(this).data("x-name");
if (!name) {
name = $(this).text();
$(this).data("x-name", name);
}
var href = $(this).attr("href");
if (href) {
var nick = href.slice(6);
@joeshaw
joeshaw / gist:1943da15f4d799f2e729
Created November 10, 2015 16:14
Onename Verification Gist
Verifying that +joeshaw is my blockchain ID. https://onename.com/joeshaw
@joeshaw
joeshaw / slack-nicknames.js
Created July 16, 2015 19:56
Using my shitty javascript skills to add Slack nicks to real names
function addNicks() {
$(".message_sender").map(function() {
var name = $(this).data("x-name");
if (!name) {
name = $(this).text();
$(this).data("x-name", name);
}
var href = $(this).attr("href");
if (href) {
var nick = href.slice(6);
import datetime
def _parse_date(d):
if isinstance(d, datetime.date):
return d
elif isinstance(d, datetime.datetime):
return d.date()
else:
return datetime.datetime.strptime(d, '%Y-%m-%d').date()

Keybase proof

I hereby claim:

  • I am joeshaw on github.
  • I am joeshaw (https://keybase.io/joeshaw) on keybase.
  • I have a public key whose fingerprint is BA36 55E3 D96B C66F 9906 3967 C6AF 28BC 42DD 4DE2

To claim this, I am signing this object:

$ python benchmark.py
JSON
0.380753993988
SimpleJSON
0.363165855408
Protocol Buffer (fast)
0.131771087646
Protocol Buffer (standard)
2.89067387581
PALM
@joeshaw
joeshaw / monitrc
Created September 20, 2011 18:09
monit configuration
set daemon 10
set logfile /var/log/monit.log
set statefile /var/lib/monit/monit.state
set alert foo@example.com not { nonexist, action, instance }
include /etc/monit/conf.d/*
@joeshaw
joeshaw / proxy_views.py
Created September 20, 2011 17:47
super-hacky flask proxy
# coding:utf-8
# Copyright 2011 litl, LLC. All Rights Reserved.
import httplib
import re
import urllib
import urlparse
from flask import Blueprint, request, Response, url_for
from werkzeug.datastructures import Headers
Process: conftest [96252]
Path: /private/tmp/homebrew-glib-2.28.7-UJKs/glib-2.28.7/conftest
Identifier: conftest
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: sh [96251]
Date/Time: 2011-07-15 16:19:15.229 -0400
OS Version: Mac OS X 10.6.8 (10K540)
Report Version: 6