Skip to content

Instantly share code, notes, and snippets.

🤦‍♂
Permanent 418 status code.

Jon Gjengset jonhoo

Block or report user

Report or block jonhoo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:66c380c32e6e90a65b11
### 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 Aug 29, 2015
Sidney Pacific Laundryview CLI
View laundry.sh
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo "$0 <machine>"
exit 1
fi
rem=""
mtype=""
state=""
state() {
@jonhoo
jonhoo / README.md
Created Jan 8, 2015
Plot commit activity across all local git repositories
View README.md

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 Jan 13, 2015
mutt-like PKGBUILD for mutt-slang
View PKGBUILD
# $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 Feb 26, 2015
Updated PKGBUILD for source-code-pro-1.017R
View PKGBUILD
# 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 Apr 15, 2015
Go slices and `interface{}`s
View README.md

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 Nov 30, 2010
A script for automatically give good filenames to TV-series episodes. Requires IMDB::Film >= 0.49
@jonhoo
jonhoo / atg-mode.el
Created Jan 22, 2011
SRI SAL mode for Emacs
View atg-mode.el
(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 Mar 19, 2011
A standalone, drop-in gallery for collections of videos and images
View index.gallery.php
@jonhoo
jonhoo / vpn.sh
Created Dec 16, 2011
Script for connecting to VPN using OpenVPN configs
View vpn.sh
#!/bin/bash
if [ -n "$1" ];
then
if [ -e "$HOME/.openvpn/$1.ovpn" ]
then
sudo openvpn --cd ~/.openvpn --config "$1.ovpn" --daemon
STATUS=$?
if [ $STATUS -eq 0 ]
then
echo "Connected to VPN network $1"
You can’t perform that action at this time.