Skip to content

Instantly share code, notes, and snippets.

@esbullington
esbullington / yubikey_public_yubikey
Last active February 8, 2021 05:32
Yubikey PGP public key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGAgyDsBEADCBLce/YkjlHKP/pFfXAlzR12seyp4SZlXGpWxESiekeCbp/KH
9G0NJqoUI80+Bb0jLD92jLY2Re72mTJUo2jdEUVYhcDk80YkLRQ49fCAEgIGBPej
gHRT+pKLEp21JbV7NYZZn3lG6yHuIaFmmD7NNKKtm11Pp9Bf5DrUwuCiC180FrT0
UsWv4n/V4/ROE8heVodcEY9UzrSQ/tKp0T4h1VT9v3Zblb1b0IwOG1UXAEjvTyoM
2EpdswBOfmmILQF6GiCneSVO96cI/Ena3I9DUDCJv4dH07h7oInWVqvlGZ+DkZ63
lW1O6tZs3zRGjuxAX4dfTPqAxTHmBbcrkqN7iRdPodh/O5dAhltjI2ZDTvXVG6iY
rGre/J+RJv8LifeKnDHvgwt6Pi4PzyNAvJifBUJKwfCn/NNyeUOgEKrETvu9SRRS
/I0RNBE4CDf2f9zy9AP6LMQ1RHVZE7HrIOSMy6nx7hoqJug5HGGotlpBSBhjb5Iw
@esbullington
esbullington / .bashrc
Created August 7, 2020 17:13
Minimal .bashrc
set -o vi
alias eb='vi ~/.bashrc'
alias sb='source ~/.bashrc'
alias et='vi ~/.tmux.conf'
alias st='source ~/.tmux.conf'
shopt -s direxpand
export HISTCONTROL=ignorespace:ignoredups
set bell-style none
if ! shopt -oq posix; then
@esbullington
esbullington / intro.md
Last active September 30, 2018 11:59
Convert Stylus to SASS/SCSS

Convert Stylus to SASS

Here's how I converted a whole batch of Stylus files to SASS without using a converter (none exist, that I'm aware of), converting each Stylus file manually, or programming my own Stylus->SASS converter, which would have entailed building a parser, and then generate SCSS from the AST.

First, grab sandr.py here: https://github.com/jfgiraud/sandr

Then, in the directory of your Stylus files, run (if you have multiple directory levels, you can do similar task using find):

for file in *.styl; do echo "/*! FILENAME: $file */" >tempfile; cat $file >>tempfile; mv tempfile $file; done 
@esbullington
esbullington / LICENSE
Created February 4, 2012 20:17
K-means clustering visualization with d3
Copyright (c) 2012, Eric S. Bullington
All rights reserved.
To be released under liberal open source license upon completion.
Clusterfck k-means library
Copyright (c) 2011 Heather Arthur <fayearthur@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining
@esbullington
esbullington / d3-zoom-drag.md
Created October 15, 2012 14:38
easy d3 zoom and pan

I know a lot of people have trouble zooming and panning d3. Indeed, I found myself in a situation where I had a simple bar chart to which I wanted to add the zoom behavior, and also make the full chart draggable. I saw several extremely complex examples of d3 charts with zooming and panning, and thought that there must be an easier way, particularly if you don't need to scale the x and y axes. There is, and here is is in CoffeeScript:

vis.call(d3.behavior.zoom()
  .on("zoom", ->
    g.attr("transform", "translate(" + d3.event.translate[0] + "," + d3.event.translate[1] + ") scale(" + d3.event.scale + ")")
  )
)
@esbullington
esbullington / getalltransactions
Created November 12, 2013 14:53
Command to fetch all Bitcoin blockchain transaction id's and put them in a (very large) text file. Requires the amazing jq, bitcoind (comes with reference client), along with standard linux coreutils.
bitcoind getblockcount | xargs seq | xargs -I{} bitcoind getblockhash {} | xargs -I{} bitcoind getblock {} | jq --raw-output '.tx[]' >> alltx.txt
@esbullington
esbullington / fips_codes.csv
Last active December 27, 2015 16:59
FIPS Codes to match the d3 cloropleth data format at http://bl.ocks.org/mbostock/raw/4090846/us.json Please note that the concatenated FIPS code at the end of each line has been put into int form to match Mike Bostock's geodata above, so leading zeros are suppressed.
state county state_code county_code fips
Alabama Autauga 01 001 1001
Alabama Baldwin 01 003 1003
Alabama Barbour 01 005 1005
Alabama Bibb 01 007 1007
Alabama Blount 01 009 1009
Alabama Bullock 01 011 1011
Alabama Butler 01 013 1013
Alabama Calhoun 01 015 1015
Alabama Chambers 01 017 1017
@esbullington
esbullington / reverse_rejection.py
Created November 3, 2012 23:28
Python script to reverse MTurk rejection using boto library and M2Crypto
#!/usr/bin/env python
import sys
# We use M2Crypto here because MTurk API does not presently allow use of IAM keys, making SSL essential
# Adapted from script by Heikki Toivonen:
# http://www.heikkitoivonen.net/blog/2009/10/12/using-m2crypto-with-boto-secure-access-to-amazon-web-services/
from M2Crypto import httpslib, SSL
from boto.mturk.connection import MTurkConnection
@esbullington
esbullington / felix_baumgartner.json
Created October 15, 2012 23:24
This is the data I've collected so far on Felix Baumgartner's historic jump
[
{
"elapsed_video_time": "00:03:20",
"velocity(mph)": "na",
"altitude": "na",
"jump_time": "None"
},
{
"elapsed_video_time": "00:03:25",
"velocity(mph)": "na",
@esbullington
esbullington / atom.xml
Created September 15, 2012 06:05
Jinja template for Atom feed
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ site_title }}</title>
<link href="{{ feed_url }}" rel="self"/>
<link href="{{ site_url }}"/>
<updated>{{ updated }}</updated>
<id>{{ id }}</id>
{% for post in articles %}