Skip to content

Instantly share code, notes, and snippets.

Permanent 418 status code.

Jon Gjengset jonhoo

Permanent 418 status code.
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 dropping-runtime.txt
#0 0x00007fafb46f7ffc in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/
#1 0x000055e6e56d7d3c in std::sys::unix::condvar::Condvar::wait (self=0x7faf9ae51130, mutex=0x7faf9ae51100)
at /checkout/src/libstd/sys/unix/
#2 0x000055e6e56d7ce6 in std::sys_common::condvar::Condvar::wait (self=0x7faf9ae51130, mutex=0x7faf9ae51100)
at /checkout/src/libstd/sys_common/
#3 0x000055e6e56d458a in std::sync::condvar::Condvar::wait (self=0x7faf9afaade8, guard=...)
at /checkout/src/libstd/sync/
#4 0x000055e6e56d0047 in futures::task_impl::std::ThreadNotify::park (self=0x7faf9afaadd0)
at /home/jon/.cargo/registry/src/
#5 0x000055e6e55f30f6 in futures::task_impl::std::<impl futures::task_impl::Spawn<F>>::wait_future::{{closure}} (
jonhoo / userChrome.css
Created Jun 5, 2018
Firefox tabs-on-bottom
View userChrome.css
@namespace url("");
/* tabs on bottom of window */
#navigator-toolbox { -moz-box-ordinal-group: 10; }
#TabsToolbar { -moz-box-ordinal-group: 10; }
#PopupAutoCompleteRichResult {
margin-top: -35vh;
position: fixed;
bottom: 74px;
jonhoo /
Created May 12, 2018
Scripts for managing SSL blacklist
echo "==> Clear blacklist"
sudo rm /etc/ca-certificates/trust-source/blacklist/*.pem
echo "==> Regenerate CA list"
sudo update-ca-trust
echo "==> Blacklisting all"
for f in /etc/ca-certificates/extracted/cadir/*.pem; do
sudo cp "$f" "/etc/ca-certificates/trust-source/blacklist/$(basename "$f")"
jonhoo / raft.go
Created Mar 16, 2016
Raft pseudocode
View raft.go
// This file gives pseudocode for the complete operation of a Raft peer,
// including the fast backtracking optimization. The implementation here is
// currently 0-indexed, as this simplifies the implementation in many cases.
// This implementation also does not discuss locks at all, which will be vital
// in any real implementation.
// ============================================================================
// The following data needs to be persisted
// ============================================================================
jonhoo /
Last active Mar 5, 2016
Script for running go tests many times in parallel, printing the current status, and logging errors
# Script for running `go test` a bunch of times, in parallel, storing the test
# output as you go, and showing a nice status output telling you how you're
# doing.
# Normally, you should be able to execute this script with
# ./
jonhoo /
Last active Oct 22, 2018
Distributed RWMutex in Go
jonhoo /
Created Apr 15, 2015
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 . 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 / PKGBUILD
Created Feb 26, 2015
Updated PKGBUILD for source-code-pro-1.017R
# Maintainer: Manuel Mendez <>
# Contributor: Jon Gjengset <>
pkgdesc="A set of monospaced fonts (TTF & OTF) designed for coding environments"
jonhoo / PKGBUILD
Created Jan 13, 2015
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]]
# Contributor: Gaetan Bisson <>
pkgdesc='Small but very powerful text-based mail client'
jonhoo /
Created Jan 8, 2015
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:

$ ./ > commits.txt
$ cat commits.txt | ./
You can’t perform that action at this time.