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
@jonhoo
jonhoo / discord-legibility.css
Last active Jul 6, 2018
Stylesheet for making Discord Light at least somewhat easier to read
View discord-legibility.css
.message-group .comment .markup, .chat {
color: inherit;
}
.message-group.compact .message .timestamp {
color: #555;
float: right;
}
.reaction .reaction-count {
color: inherit;
@progandy
progandy / PKGBUILD
Last active Aug 29, 2017
Minimal MPRIS2 support for mpv
View PKGBUILD
# PKGBUILD for lua52-lgi
# Maintainer: NONE
# lua-lgi Maintainer: speps <speps at aur dot archlinux dot org>
# lua-lgi Maintainer: Sébastien Luttringer
_pkgbase=lgi
pkgname=lua52-lgi
pkgver=0.9.1
pkgrel=1
pkgdesc='Lua 5.2 bindings for gnome/gobject using gobject-introspection library'
anonymous
anonymous / playground.rs
Created Apr 6, 2016
Shared via Rust Playground
View playground.rs
//! This code demonstrates a data flow-like programming pattern, in which each
//! vertex of a DAG is associated with a long-running thead. The vertices
//! forward information along the edges, and the leaves just print out any data
//! they see. In this example, the vertices perform no computation, whereas
//! normally they would.
use std::thread;
use std::sync;
use std::sync::mpsc;
use std::collections::HashMap;
@jonhoo
jonhoo / go-test-many.sh
Last active Mar 5, 2016
Script for running go tests many times in parallel, printing the current status, and logging errors
View go-test-many.sh
#!/bin/bash
#
# 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
#
# ./go-test-many.sh
#
@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 / 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
@Kroc
Kroc / domtemplate.php
Created Jan 4, 2012
DOM Template Class
View domtemplate.php
<?php
//DOM Templating classes v7 © copyright (cc-by) Kroc Camen 2012
//you may do whatever you want with this code as long as you give credit
//documentation at http://camendesign.com/dom_templating
class DOMTemplate extends DOMTemplateNode {
private $DOMDocument;
private $keep_prolog = false;
@gf3
gf3 / ago.js
Created Jun 2, 2011
Super small relative dates
View ago.js
module.exports = (function(){
const MS =
{ seconds: 1000
, minutes: 60 * 1000
, hours: 60 * 60 * 1000
, days: 24 * 60 * 60 * 1000
, weeks: 7 * 24 * 60 * 60 * 1000
, months: 30 * 7 * 24 * 60 * 60 * 1000
, years: 365 * 24 * 60 * 60 * 1000 }
@jonhoo
jonhoo / seriex.markdown
Created Nov 30, 2010
A script for automatically give good filenames to TV-series episodes. Requires IMDB::Film >= 0.49
You can’t perform that action at this time.