Skip to content

Instantly share code, notes, and snippets.

@myersjustinc
myersjustinc / totp_qrcodes.js
Created October 19, 2018 03:57
Render QR codes to set up TOTP secrets
const qrcode = require('qrcode-terminal');
[
// {issuer: '', user: '', secret: ''}, // TODO: Fill these in.
].forEach(function(keyInfo) {
const issuer = encodeURIComponent(keyInfo.issuer);
const user = encodeURIComponent(keyInfo.user);
const secret = keyInfo.secret.replace(/ /g, '');
const url = (
`otpauth://totp/${issuer}:${user}?secret=${secret}&issuer=${issuer}`);

Keybase proof

I hereby claim:

  • I am myersjustinc on github.
  • I am myersjustinc (https://keybase.io/myersjustinc) on keybase.
  • I have a public key ASDvlhU6bsbNXnPqksGZHGySq2L9Pd6SmKbaSTvB1Q-VIAo

To claim this, I am signing this object:

@myersjustinc
myersjustinc / nc.geojson
Created January 10, 2018 21:58
North Carolina's U.S. House districts for 115th Congress (extracted from TIGER/Line)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@myersjustinc
myersjustinc / README.md
Last active March 8, 2023 20:39
Remove Great Lakes and other water from Congressional districts shapefile

Remove Great Lakes and other water from Congressional districts shapefile

The problem

You want the most up-to-date shapefile of Congressional districts, but you don't want Michigan to be a giant blob.

(The Census Bureau offers some cartographic boundary shapefiles without this problem, but they aren't always the most current.)

@myersjustinc
myersjustinc / batik.rb
Created December 2, 2016 21:37
Homebrew formula for Batik with proper FOP (2.1) transcoder
class Batik < Formula
desc "Java-based toolkit for SVG images"
homepage "https://xmlgraphics.apache.org/batik/"
url "https://associatedpress-datateam-automation.s3.amazonaws.com/misc/batik-bin-1.8.tar.gz"
sha256 "424c59245471d1134c45d549c5cd995fa6444fa2c0f429cee26c193c049c5e21"
bottle :unneeded
def install
libexec.install "lib", Dir["*.jar"]
@myersjustinc
myersjustinc / rvm.md
Last active November 10, 2016 18:58
RVM things I've run into
  • SSL issues when installing any gem, either using gem install or bundle install:

    • Replace the certs from rvm osx-ssl-certs with the ones from cURL:

      $ wget 'https://curl.haxx.se/ca/cacert.pem'
      $ cp cacert.pem /usr/local/etc/openssl/cert.pem
      $ sudo cp cacert.pem /etc/openssl/cert.pem
      
  • Switching Ruby versions inside a Python virtualenv throws a warning such as:

@myersjustinc
myersjustinc / tabula-java.rb
Created February 4, 2016 17:23
tabula-java Homebrew formula
class TabulaJava < Formula
desc "Text extraction from PDFs, using command-line Tabula core"
homepage "https://github.com/tabulapdf/tabula-java"
version "0.8.0"
head "https://github.com/tabulapdf/tabula-java.git", :revision => "577916327edd480b81604b1df63a9a583b814f5c"
depends_on "maven"
def install
@myersjustinc
myersjustinc / update_virtualenvs.sh
Created December 10, 2015 15:40
Update Python version in virtualenvs after upgrade
#!/bin/bash
# When you upgrade your Python installation in Homebrew, any virtualenvs that
# relied on that Python installation will stop working because of some broken
# symlinks.
#
# Stéphane Wirtel documented a solution:
# http://wirtel.be/posts/en/2014/07/29/fix_virtualenv_python_brew/
#
# This automates that for all virtualenvs installed with virtualenvwrapper
@myersjustinc
myersjustinc / keybase.md
Created November 16, 2015 02:41
Keybase proof

Your username on GitHub: myersjustinc Please publicly post the following Gist, and name it keybase.md:

Keybase proof

I hereby claim:

  • I am myersjustinc on github.
  • I am myersjustinc (https://keybase.io/myersjustinc) on keybase.
  • I have a public key whose fingerprint is E696 5388 5DF6 B978 30A5 6723 DBCE 2CD7 D0E2 F991
@myersjustinc
myersjustinc / transition.txt
Created November 16, 2015 02:35
GPG key transition statement
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
I am transitioning GPG keys away from an old smartcard-generated key to a new
set of smartcard-stored subkeys over which I have more granular control.
There is no urgent reason for this transition other than the fact that my old
key is expiring, which makes this as convenient a time as any. My hope is that
I will be able to manage my key more effeciently going forward with this new
setup and new workflow.