Skip to content

Instantly share code, notes, and snippets.

View jonhoo's full-sized avatar
🤦‍♂️
Permanent 418 status code.

Jon Gjengset jonhoo

🤦‍♂️
Permanent 418 status code.
View GitHub Profile
### Keybase proof
I hereby claim:
* I am jonhoo on github.
* I am jonhoo (https://keybase.io/jonhoo) on keybase.
* I have a public key whose fingerprint is 0EB8 140B 1294 C265 5DDD BF0C D64A C9D6 7176 DC71
To claim this, I am signing this object:
@jonhoo
jonhoo / laundry.sh
Last active August 29, 2015 14:06
Sidney Pacific Laundryview CLI
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo "$0 <machine>"
exit 1
fi
rem=""
mtype=""
state=""
state() {
@jonhoo
jonhoo / README.md
Created January 8, 2015 22:50
Plot commit activity across all local git repositories

These scripts will find all git repositories on the local machine, find all commits made by some user (specified as arguments to find-commits), and plot the number of commits, lines added, and lines removed over time. Commits that add or remove over 10000 lines will be ignored (for huge data files and such).

To run:

$ ./find-commits.sh jon@thesquareplanet.com jon@tsp.io > commits.txt
$ cat commits.txt | ./draw-commits.sh
@jonhoo
jonhoo / PKGBUILD
Created January 13, 2015 21:28
mutt-like PKGBUILD for mutt-slang
# $Id: PKGBUILD 207672 2014-03-13 00:02:32Z bisson $
# Maintainer: Sean Greenslade <sean at seangreenslade dot com>
# Contributor: tobias [tobias [at] archlinux.org]
# Contributor: Gaetan Bisson <bisson@archlinux.org>
pkgbase=mutt
pkgname=${pkgbase}-slang
pkgver=1.5.23
pkgrel=2
pkgdesc='Small but very powerful text-based mail client'
@jonhoo
jonhoo / PKGBUILD
Created February 26, 2015 15:57
Updated PKGBUILD for source-code-pro-1.017R
# Maintainer: Manuel Mendez <mmendez534@gmail.com>
# Contributor: Jon Gjengset <jon@tsp.io>
pkgname=source-code-pro-fonts-powerline
pkgver=1.017
pkgrel=3
pkgdesc="A set of monospaced fonts (TTF & OTF) designed for coding environments"
arch=('any')
license=('custom:OFL')
url='http://sourceforge.net/projects/sourcecodepro.adobe/'
@jonhoo
jonhoo / README.md
Created April 15, 2015 21:06
Go slices and `interface{}`s

When passing Go slices through interface{} values, beware that this slows your application down. If possible, you should instead be passing around pointers to slices, and dereference them after the cast:

$ go test -c
$ ./x.test -test.bench . -test.run Benchmark -test.benchtime 3s
BenchmarkInterfaceSlice		30000000	        148 ns/op
BenchmarkInterfaceSlicePtr	300000000	       14.0 ns/op
$ go tool pprof -text -cum x.test slice.out | grep -vE 'testing|goexit|Benchmark'
4420ms of 4610ms total (95.88%)
Dropped 16 nodes (cum <= 23.05ms)
@jonhoo
jonhoo / seriex.markdown
Created November 30, 2010 05:06
A script for automatically give good filenames to TV-series episodes. Requires IMDB::Film >= 0.49
@jonhoo
jonhoo / atg-mode.el
Created January 22, 2011 07:25
SRI SAL mode for Emacs
(require 'generic-x) ;; we need this
(define-generic-mode
'atg-mode ;; name of the mode to create
'("---") ;; comments start with '!!'
'("Path" "Step") ;; some keywords
'(("=" . 'font-lock-function-name-face)) ;; '=' is an operator
'("\\.atg$") ;; files for which to activate this mode
nil ;; other functions to call
"A mode for SRI SAL ATG generated files" ;; doc string for this mode
@jonhoo
jonhoo / index.gallery.php
Created March 19, 2011 06:43
A standalone, drop-in gallery for collections of videos and images
@jonhoo
jonhoo / wifi.markdown
Created March 5, 2012 02:10
Perl script for scanning for wireless networks and creating NetCFG profiles