Skip to content

Instantly share code, notes, and snippets.

View ryankanno's full-sized avatar
🇯🇵
Deconstructing

Ryan Kanno ryankanno

🇯🇵
Deconstructing
View GitHub Profile
@ryankanno
ryankanno / keybase.md
Created November 21, 2020 02:54
Keybase verification

Keybase proof

I hereby claim:

  • I am ryankanno on github.
  • I am ryankanno (https://keybase.io/ryankanno) on keybase.
  • I have a public key ASCGd7RtZOPgsa9OkAecXNTN8U0tvewxnF-nejbt4qs3Xgo

To claim this, I am signing this object:

@ryankanno
ryankanno / Instructions.md
Last active November 19, 2020 05:20
Small ObjectiveC program to switch your Mac Catalina input source.

Hic sunt dracones

My partner needed an Alfred script to switch their Mac Catalina input source to Japanese using a keyboard shortcut because of the Moonlander.

After looking at a few (outdated) solutions on their forums and on the Internet, there didn't seem to be any reliable ones, so I just cobbled a script together.

*I'm not a Objective C developer so if you have any improvements, feel free to update this.

General idea is to get a list of your available input sources, iterate until we find one that has a localized name that matches the parameter you pass in,

Instructions

These instructions will help you better analyze the IRS 990 public dataset. The first thing you'll want to do is to read through the documentation over at Amazon. There's a ~108MB index file called index.json.gz that contains metadata describing the entire corpus.

To download the index.json.gz metadata file, you'll want to issue the following command: curl https://s3.amazonaws.com/irs-form-990/index.json.gz. Once you've downloaded the index.json.gz file, you can extract its contents with the following command: gunzip index.json.gz. To take a peek at the extracted contents, use the following command: head index.json.

Looking at the index.json file, you'll notice that it contains a json structure represented as a string. It contains an array of json objects that look like the following:

{"EIN": "721221647", "SubmittedOn": "2016-02-05", "TaxPeriod": "201412", "DLN": "93493309001115", "LastUpdated": "2016-03-21T17:2
@ryankanno
ryankanno / tmux-helper
Created February 27, 2014 04:06
Tmux helper to list tmux sessions, attach to an existing session, or create a brand new one!
function tm() {
if [ -n "$1" ]; then
tmux attach -t $1 2>/dev/null || tmux new -s $1
else
tmux list-sessions 2> >(grep -q 'failed')
if [ "$?" -eq 1 ]; then
echo "No available tmux sessions. Please create one."
fi
fi
}
@ryankanno
ryankanno / attack_of_the_clones.sh
Created March 1, 2013 12:26
Clone all the repos! StartupBus 2013 prep. :D
#!/bin/bash
repos=(
'https://github.com/github/gitignore'
'https://github.com/twitter/bootstrap'
'https://github.com/h5bp/html5-boilerplate'
'https://github.com/cloudhead/less.js'
'https://github.com/jquery/jquery'
'https://github.com/jquery/jquery-mobile'
@ryankanno
ryankanno / top10
Created April 17, 2012 05:02
Where has all the disk space gone?
du -x -k | sort -nr | head -<n>
@ryankanno
ryankanno / uwsgi.xml
Created February 2, 2012 06:04
uwsgi.xml configuration file for Ubuntu 11.10 init.d
<uwsgi>
<socket>127.0.0.1:12345</socket>
<pythonpath>/home/apps/allbus/current</pythonpath>
<module>wsgi</module>
<plugins>python</plugins>
<processes>1</processes>
<pidfile>/var/run/uwsgi/%n/pid</pidfile>
<daemonize/>
<uid>33</uid>
<gid>33</gid>