Skip to content

Instantly share code, notes, and snippets.

View beaugunderson's full-sized avatar
type type type

Beau Gunderson beaugunderson

type type type
View GitHub Profile
@beaugunderson
beaugunderson / user-style.css
Last active October 26, 2015 12:50
hamburger-buttons
.navbar-toggle {
background-image: url(http://i.imgur.com/NBCwtIw.png);
background-position: center;
background-size: 90%;
background-repeat: no-repeat;
}
@beaugunderson
beaugunderson / wrap.js
Last active December 10, 2015 14:28 — forked from anonymous/gist:4447348
var original = cb;
cb = function wrapper() {
var args = arguments;
process.nextTick(function () {
original.apply(wrapper, args);
});
};
#!/bin/bash
TOKEN=""
API_URL="https://api.instagram.com/v1"
PHOTO_ID="358863216058600582_3832082"
function get_liked() {
http GET "$API_URL/media/$PHOTO_ID?access_token=$TOKEN" | jsonpipe | grep user_has_liked
}
#!/bin/sh
# Uses httpie: https://github.com/jkbr/httpie
BASE_URL="https://api.singly.com/"
CLIENT_ID=""
CLIENT_SECRET=""
USERNAME=""
#!/bin/bash
echo "Gathering 60s of data for process ID $1"
dtrace -n "profile-997/pid == $1 && arg1/{
@[jstack(50, 2048)] = count(); } tick-30s { exit(0); }" > $1.out
echo "Filtering..."
c++filt < $1.out > $1-demangled.out
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rollcall-vote PUBLIC "-//US Congress//DTDs/vote v1.0 20031119 //EN" "http://clerk.house.gov/evs/vote.dtd">
<?xml-stylesheet type="text/xsl" href="http://clerk.house.gov/evs/vote.xsl"?>
<rollcall-vote>
<vote-metadata>
<majority>R</majority>
<congress>113</congress>
<session>1st</session>
<committee>U.S. House of Representatives</committee>
@beaugunderson
beaugunderson / index.js
Created August 29, 2013 20:42
requirebin sketch
var exifParser = require('exif-parser');
var $ = require('jquery-browserify');
var doc = document.documentElement;
doc.ondragover = function () {
return false;
};
doc.ondragend = function () {
@beaugunderson
beaugunderson / turtle.js
Last active December 22, 2015 08:18
Playing with the ctx in @tmcw's turtle
turtle(function (t) {
ctx.lineWidth = 3;
var fns = [];
[0, 35, 70, 105].forEach(function (a) {
[0, -90, 180, 90, 180].forEach(function (off) {
fns.push(function (t) {
// Originally I just wanted to avoid dense black lines interfering with my ability
// to read the text as I was typing but then figured why not play with opacity
#!/usr/bin/env python2.7
import json
import sys
try:
log = json.loads(sys.stdin.read())
except:
print "Couldn't parse."
import os
from contextlib import contextmanager
from fabric.api import env, hide, local
@contextmanager
def mysql_password(database):
contents = """
[client]