Skip to content

Instantly share code, notes, and snippets.

*** glibc detected *** python2.7: free(): invalid pointer: 0x000000000e41a8a0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7e626)[0x7f5ab00f1626]
python2.7[0x559b31]
python2.7[0x426577]
/usr/local/lib/python2.7/dist-packages/sqlalchemy/cresultproxy.so(+0x1813)[0x7f5aadefd813]
python2.7[0x5020b8]
python2.7[0x425e5c]
python2.7[0x425d02]
python2.7[0x5754ad]
@mccutchen
mccutchen / README.md
Last active August 29, 2015 14:05
Java is the worst.

Java is the Worst

All I want to do is sort an array of ints by some arbitrary function, criteria(). This is the the only way I've figured out how to do it in Java.

There's a Python implementation of the same thing, for comparison's sake.

  1. Decide you want to make n delicious burgers

  2. Go to a butcher, buy n/2 lbs of ribeye steak, ask them to grind it for you

  3. Make that beautiful ground ribeye into 1/2 lb patties

  4. Sprinkle sea salt and ground black pepper on both sides of the patties

  5. Heat cast iron skillet to 400 degrees in an oven (leave the oven at 400)

Keybase proof

I hereby claim:

  • I am mccutchen on github.
  • I am mccutchen (https://keybase.io/mccutchen) on keybase.
  • I have a public key whose fingerprint is C280 17A1 5056 9A15 5E8D 1016 B0C1 944A 52EF E3B6

To claim this, I am signing this object:

@mccutchen
mccutchen / config.xml
Last active August 29, 2015 14:02
Cordova config.xml for iOS
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.example.foo" version="0.0.28" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>Foo</name>
<description>bla bla bla</description>
<author email="[email protected]" href="http://phonegap.com">Foo</author>
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="DisallowOverscroll" value="true" />
<preference name="EnableViewportScale" value="false" />
@mccutchen
mccutchen / json_to_csv.py
Last active January 4, 2016 20:29
Trying to help Marshal munge some data
#!/usr/bin/env python
import csv
import fileinput
import json
import sys
def main():
fields = set()
@mccutchen
mccutchen / brunswick-stew.txt
Last active December 28, 2015 03:38
Glenn McCutchen's World Famous Brunswick Stew
Glenn McCutchen's World Famous© Brunswick Stew
----------------------------------------------
Ingredients:
Salt....................to taste
Pepper..................to taste
Tabasco© Sauce..........to taste
Chicken.................One (1) pound, more or less
Pork....................One (1) pound, give or take
@mccutchen
mccutchen / require_js_refactor.py
Created November 11, 2013 17:12
Script used to refactor the style of requirejs imports we were using.
import os
import re
example = """define([
'jquery',
'underscore',
'backbone',
'lib/db_session',
# Super simple apache config for serving humortree locally under
# OS X. The default apache config includes other/*.conf, so just
# stick this somewhere like:
#
# /etc/apache2/other/humortree.conf
<VirtualHost *:80>
DocumentRoot "/Users/mccutchen/workspace/humortree.org"
ServerName humortree.local
ErrorLog "/private/var/log/apache2/humortree.local-error_log"
@mccutchen
mccutchen / duraction.diff
Created October 4, 2013 18:59
The worst commit of my life.
commit 7b4e29d030812813e29f7008da45502a68a583b3
Author: Will McCutchen <[email protected]>
Date: Fri Oct 4 18:45:10 2013 +0000
api: allow 0 as rescheduling duration.
The actual work of magically rescheduling to today in that case is
left as an exercise for Snakes.
diff --git a/api_v1/app/pattern.py b/api_v1/app/pattern.py