Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am tobym on github.
  • I am tobym (https://keybase.io/tobym) on keybase.
  • I have a public key ASAxXn3ku_9fH4jsuH6cK2W-h5_7bW3IzY2M2jt1Y10xKQo

To claim this, I am signing this object:

@tobym
tobym / proxy.sh
Created March 28, 2017 10:18
When you're abroad and want to listen to Pandora on your mac...
# create a SOCKS proxy. You need a server in the US
ssh -D 8888 my-user@server-in-the-us
# launch a second instance of Chrome that uses the proxy
/Applications/Google Chrome.app/Contents/MacOS/Google\ Chrome --profile-directory=Guest --proxy-server="socks5://localhost:8888" --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE localhost" --user-data-dir="/tmp"
$ sbt -Dredis:6379=propset run
[info] Set current project to test (in build file:/Users/toby/asldifjasklfjsd/)
[info] Running Main
hello world
propset
[success] Total time: 1 s, completed May 19, 2016 1:42:01 PM
@tobym
tobym / criteria.txt
Last active September 11, 2015 19:45 — forked from gigamonkey/criteria.txt
Hiring criteria: looking for the ability to …
Write a program that does what it’s supposed to do
Write idiomatic code
Debug a program that you wrote
Debug a program someone else wrote
Debug the interaction between a system you wrote and one you didn’t
File a good bug report
Modify a program you didn’t write
Test a program you wrote
Test a program you didn’t write
Learn a new programming language
@tobym
tobym / git-freshness
Created February 26, 2015 21:34
Run `git freshness` to see remote branches sorted by their last commit date
#!/bin/sh
for branch in `git branch -r | grep -v HEAD`;do echo $(git show --pretty=format:'%ci|%an|%cr|' $branch | head -n 1)$branch; done | sort | column -t -s '|'
@tobym
tobym / git-stats
Created January 14, 2015 21:30
Git extension that shows aggregate --numstat information by author.
#!/bin/bash
# Usage: git stats [options]
# options are any git options that you would pass to "git log", such as "--since 14.days" or path/to/file/or/directory
#
# Prints commit stats alphabetically by author: number of files changes, number of lines inserted, number of lines deleted.
#
# To sort by files changed, use sort like so: git stats | sort -t, -bn -k2
# This tells sort to separate fields by comma, then do a numerical sort on the second field (files changed), ignoring leading whitespace
# (That works with gnu and BSD sort.)
@tobym
tobym / build.sbt
Created January 13, 2015 17:01
sbt-native-packager example, based on minimal-akka-scala-seed activator template
import com.typesafe.sbt.SbtNativePackager._
import NativePackagerKeys._
name := """minimal-akka-scala-seed"""
version := "1.0"
scalaVersion := "2.11.1"
libraryDependencies ++= Seq(
@tobym
tobym / randomword.sh
Last active August 29, 2015 14:08
This script prints a random word to stdout.
#!/bin/bash
function print_random_word {
# The dictionary file. It contains one word per line.
dictionary=/usr/share/dict/words
# The number of words in the dictionary file.
num_words_in_dictionary=$(wc -l $dictionary | awk '{print $1}')
# A random number corresponding to a line in the dictionary file.
@tobym
tobym / mkString
Created September 5, 2014 21:51
Join lines with a given separator by piping a file to this script.
#!/usr/bin/env bash
#
# Usage: cat somefile.txt | mkString [sep]
#
paste -s -d$1 -
@tobym
tobym / analytics.json
Created July 2, 2014 02:54
sample tapad cross-device analytics response
{
"analytics": {
"fvp": "Computer",
"movp": "Computer",
"mrvp": "Computer",
"pa": "1",
"pt": "Computer",
"vp": "1"
}
}