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
<?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>
#!/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
#!/bin/sh
# Uses httpie: https://github.com/jkbr/httpie
BASE_URL="https://api.singly.com/"
CLIENT_ID=""
CLIENT_SECRET=""
USERNAME=""
#!/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
}
@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
RETURN=0
COUNT=0
while [ $RETURN == 0 ]; do
COUNT=$(($COUNT + 1))
echo "Test run $COUNT"
@beaugunderson
beaugunderson / gist:4052252
Created November 10, 2012 19:44
oauth 0.9.6 vs. zeo/oauth
diff -r -u node_modules/oauth/lib/oauth.js oauth/lib/oauth.js
--- node_modules/oauth/lib/oauth.js 2012-03-02 13:38:30.000000000 -0800
+++ oauth/lib/oauth.js 2012-11-10 11:42:55.000000000 -0800
@@ -309,7 +309,8 @@
headers["Authorization"]= authorization;
}
- headers["Host"] = parsedUrl.host
+ headers["Host"] = parsedUrl.host;
+ headers["Referer"] = 'http://localhost:8042';
[ec2-23-20-4-55.compute-1.amazonaws.com] sudo: npm shrinkwrap
[ec2-23-20-4-55.compute-1.amazonaws.com] out: npm ERR! Error: Problems were encountered
[ec2-23-20-4-55.compute-1.amazonaws.com] out: npm ERR! Please correct and try again.
[ec2-23-20-4-55.compute-1.amazonaws.com] out: npm ERR! extraneous: [email protected] /srv/singly/hallway/node_modules/mime-magic
[ec2-23-20-4-55.compute-1.amazonaws.com] out: npm ERR! extraneous: [email protected] /srv/singly/hallway/node_modules/libxml-to-js
[ec2-23-20-4-55.compute-1.amazonaws.com] out: npm ERR! extraneous: [email protected] /srv/singly/hallway/node_modules/aws2js
[ec2-23-20-4-55.compute-1.amazonaws.com] out: npm ERR! at shrinkwrap_ (/usr/lib/nodejs/npm/lib/shrinkwrap.js:28:15)
[ec2-23-20-4-55.compu
@beaugunderson
beaugunderson / loadenv.sh
Created October 15, 2012 23:18 — forked from kristjan/loadenv.sh
Load a .env file into your current shell. Handy when you need to skirt Foreman.
function loadenv_inner() {
cat .env | while read line; do
echo export $line
done
}
function loadenv() {
if [ -f .env ]; then
eval `loadenv_inner`
else
@beaugunderson
beaugunderson / gist:2054996
Created March 17, 2012 04:41
Human-readable long epoch dates in vim
" Human-readable long epoch dates (long meaning those that include milliseconds)
function! DateFromLongEpoch()
" Let the shell divide because vim only supports 32 bit ints
let sdate=system("echo $((". expand("<cword>") ."/1000))")
" Format the date
let human=tolower(substitute(strftime("%m/%d/%y %I:%M:%S%p", sdate), "\\\<0", "", "g"))
return human ." (". (sdate - localtime()) ." seconds from now)"
endfunc