Skip to content

Instantly share code, notes, and snippets.

Thomas Buckley-Houston tombh

Block or report user

Report or block tombh

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:9c622404fb41f2343a0db85b3821275d
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
remarkablemark / Dockerfile
Last active Nov 14, 2019
Install node and npm with nvm using Docker.
View Dockerfile
# set the base image to Debian
FROM debian:latest
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \
gilbert / ajax-loader.scss
Created Jul 8, 2015
Global Mithril.js AJAX Loader
View ajax-loader.scss
// Taken from
uiload {
display: inline-block;
position: relative;
& > div {
position: relative;
@-webkit-keyframes ajax-loader {
pixeltrix /
Last active Oct 31, 2019
When should you use DateTime and when should you use Time?

When should you use DateTime and when should you use Time?

It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime steps in:

>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000
eevee / fonts.conf.xml
Last active Dec 6, 2018
my fonts.conf
View fonts.conf.xml
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<family>Source Serif Pro</family>
View bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
NodeList.prototype.__proto__ = Array.prototype;
lmars / commands.txt
Last active Jan 22, 2016
Flynn Redis
View commands.txt
# create a redis app
flynn create --remote "" redis
# create a release using the latest (at the time of writing) Docker Redis image
flynn -a redis release add -f config.json ""
# scale the server to one process. This may time out initially as the server pulls the image, but watch "flynn -a redis ps" and should come up.
flynn -a redis scale server=1
# redis should now be running in the cluster at redis.discoverd:6379
james-huston /
Last active Feb 7, 2018
HAProxy stats to StackDriver using a shell script
# run this every minute from cron as a quick and dirty solution to get some
# haproxy stats on each of your listeners over to stackdriver
instance=$(curl -s "")
# while [ 1 ]; do
cp /dev/null /tmp/hastats.json
echo 'show stat' | socat - UNIX-CLIENT:/tmp/haproxy.sock \
|while IFS=',' read pxname svname qcur qmax scur smax slim stot bin bout dreq \
dresp ereq econ eresp wretr wredis status weight act bck chkfail chdown lastchg \
XVilka /
Last active Nov 14, 2019
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
Earlz / gist:5848045
Last active Dec 18, 2015
This is the oldest program I can find that once worked which I wrote. This was probably written in either 2003 or 2004 in DarkBasic Professional. I would have been 13 at the time.
View gist:5848045
rem this is a generic media player
rem this prog was made by jordan earls
print "type 1 to choose where media is"
print "type 2 to pause music"
print "type 3 to resume music"
print "type 4 to reload music"
print "type 5 to change volume"
print "type 6 to change speed"
You can’t perform that action at this time.