Skip to content

Instantly share code, notes, and snippets.

type type type

Beau Gunderson beaugunderson

type type type
View GitHub Profile
mbostock / .block
Last active Feb 8, 2016
Polymaps + D3, Part 2
View .block
license: gpl-3.0
mbostock / .block
Last active Jan 18, 2021
Google Maps + D3
View .block
license: gpl-3.0
beaugunderson / .vimrc
Created Jul 31, 2011
Prompt to edit a corresponding .scss file when opening a .css file in vim
View .vimrc
function! EditScss()
" The current file
let file = expand("%")
" The current file's basename plus .scss
let scss = expand("%:r") . ".scss"
" If the file exists
if filereadable(scss)
" Prompt the user and store the user's choice (1-indexed) in a variable
deoxxa / parallelworlds.json
Created Mar 7, 2013
SimCity (2013) Studies
View parallelworlds.json
// Intercepting this request and changing the "Desc" field does nothing to the
// game's UI. The name in the interface seems to come from looking up the "id"
// field against a list of names stored internally. Probably because of locale
// stuff.
// Note the hidden servers!
View gist:6481605
[{"index": 0, "id": "<redacted>", "habit": {"week": "2013-08-26", "goal_units": "timedelta", "daily_scores": [{"total_points": 128, "state": 13, "score": 1439, "goal": 720.0, "last_timestamp": "2013-08-26T23:59:00+5:00", "base_points": 25, "day": "monday"}, {"total_points": 125, "state": 13, "score": 1438, "goal": 720.0, "last_timestamp": "2013-08-27T23:59:00+5:00", "base_points": 25, "day": "tuesday"}, {"total_points": 125, "state": 13, "score": 1439, "goal": 720.0, "last_timestamp": "2013-08-28T23:59:00+5:00", "base_points": 25, "day": "wednesday"}, {"total_points": 125, "state": 13, "score": 1430, "goal": 720.0, "last_timestamp": "2013-08-29T23:59:00+5:00", "base_points": 25, "day": "thursday"}, {"total_points": 125, "state": 13, "score": 1440, "goal": 720.0, "last_timestamp": "2013-08-30T23:59:00+5:00", "base_points": 25, "day": "friday"}, {"total_points": 125, "state": 13, "score": 1434, "goal": 720.0, "last_timestamp": "2013-08-31T23:59:00+5:00", "base_points": 25, "day": "saturday"}, {"total_points": 1
trevnorris /
Last active Jul 21, 2021
Quick steps of how to create a flame graph using perf

The will setup the latest Node and install the latest perf version on your Linux box.

When you want to generate the flame graph, run the following (folder locations taken from install script):

sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading )
sudo sysctl kernel.perf_event_paranoid=0
trevnorris /
Last active Dec 9, 2017
Here's a rundown of everything I use to do performance analysis in Node.


Here is a collection of tips and tricks I've picked up about doing performance analysis on Node. Included is a build script that should get a base install of Ubuntu fully functional and ready for all the things we'll be going through.

The script pulls a lot of code from the latest master of each repository. So it's possible that something may fail, but to date I haven't had any issues.

First, go ahead and run the script. Then go take a nice long break. It'll

View app_auth.js
#!/usr/bin/env node
var inquirer = require("inquirer"),
request = require("request"),
qs = require('querystring'),
fs = require('fs');
var request_token_url = '',
access_token_url = '';
airhadoken / twittercard.js
Last active Dec 13, 2020
Making twitter cards and also getting data back from them later, in NodeJS.
View twittercard.js
var T = require("twit");
var Q = require("q");
// key and secret for Twitter for iPhone.
// A whitelisted app is needed to access the cards API; you can't just create your own currently.
// These you will have to fill in yourself by authorizing Twitter for iPhone for your account.
// How to get the access tokens through OOB authorization is outside the scope of this snippet.
SimplGy /
Last active Feb 21, 2021
Rename files with a hash based on their contents. eg: `abc.jpg` to `3101ace8db9f.jpg`. Useful for detecting duplicates.
# TODO: skip tiny files (so small they couldn't be photos)
# TODO: make sure sym links and other file system oddities are handled
# TODO: look at paralellization for perf boost
# Constants