Skip to content

Instantly share code, notes, and snippets.

View silentbicycle's full-sized avatar

Scott Vokes silentbicycle

  • Fastly (@fastly)
  • Grand Rapids, MI
View GitHub Profile
@silentbicycle
silentbicycle / Yes.
Created May 7, 2013 17:34
The only limit is yourself.
$ cat ~/tmp/welcome
__ __ _ _
\ \ / /__| | ___ ___ _ __ ___ ___ | |_ ___
\ \ /\ / / _ \ |/ __/ _ \| '_ ' _ \ / _ \ | __/ _ \
\ V V / __/ | (_| (_) | | | | | | __/ | || (_) |
\_/\_/ \___|_|\___\___/|_| |_| |_|\___| \__\___/
_____ _ ____
|__ /___ _ __ ___ | |__ ___ / ___|___ _ __ ___
/ // _ \| '_ ' _ \| '_ \ / _ \| | / _ \| '_ ' _ \
@silentbicycle
silentbicycle / array.lua
Created May 12, 2013 16:11
quick draft of an array/vector library for lua (mostly as an example of metatables)
local NONE = setmetatable({}, {['__tostring'] = function() return "NONE" end})
local Array = {
['__newindex'] = function(a, k, v)
if type(k) ~= "number" then error("bad index") end
if k < 1 then error("out of bounds") end
if a._lim ~= NONE and k <= a._lim then
a._v[k] = v
elseif a._lim == NONE then
if k > a._len then
@silentbicycle
silentbicycle / rfcify
Created August 12, 2013 18:47
If you MUST sound like an IETF RFC (using cat is RECOMMENDED)
#!/bin/sh
sed -e "s/must/MUST/" \
-e "s/must not/MUST NOT/" \
-e "s/required/REQUIRED/" \
-e "s/shall/SHALL/" \
-e "s/shall not/SHALL NOT/" \
-e "s/should/SHOULD/" \
-e "s/should not/SHOULD NOT/" \
-e "s/recommended/RECOMMENDED/" \
-e "s/may/MAY/" \
@silentbicycle
silentbicycle / pirate.cow
Created September 9, 2013 22:02
Pirate cow, for cowsay(1). Goes in /usr/local/share/cows/ or wherever your cowsay install puts it.
$eye = chop($eyes);
$the_cow = <<"EOC";
$thoughts A__^
$thoughts ($eye#)\\_______
(__)\\ )\\/\\
$tongue ||----w |
J| |V
EOC
@silentbicycle
silentbicycle / gist:7853896
Last active December 30, 2015 16:19
Setlist for The Mountain Goats at the Ladies Literary Club, Grand Rapids, MI 2009-11-04
Setlist for The Mountain Goats at the Ladies Literary Club,
Grand Rapids, MI, 2009-11-04
https://dl.dropboxusercontent.com/u/76615635/tmg-2009-11-04-GRMI-LLC.mp3
Handball
Old College Try
Psalms 40:2
Has Thou Considered the Tetrapod
Genesis 3:23
Genesis 30:3
@silentbicycle
silentbicycle / handwarmer.c
Created January 2, 2014 17:53
handwarmer.c
/*
* Copyright (c) 2014 Scott Vokes <vokes.s@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@silentbicycle
silentbicycle / linear-time-indexing-sort.c
Last active January 3, 2016 01:29
simple linear-time sorting algorithm, using a flattened linked-list index
/*
* Copyright (c) 2014 Scott Vokes <vokes.s@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@silentbicycle
silentbicycle / cable_clip.scad
Created March 25, 2014 23:55
3D-printable cable clip
USB_A_w = 12; // USB-A clip width
h = 2;
th = 3;
w = 73.25;
d = 30;
ith = .4*d - th;
union() {
// end
@silentbicycle
silentbicycle / pirate.cow
Created July 14, 2014 22:43
pirate.cow
$eye = chop($eyes);
$the_cow = <<"EOC";
$thoughts A__^
$thoughts ($eye#)\\_______
(__)\\ )\\/\\
$tongue ||----w |
J| |V
EOC
@silentbicycle
silentbicycle / gist:d8278c49599e3cd68042
Created November 12, 2014 14:26
ugly GNU make hackery
include fake_init
all: actual_target
fake_init:
@echo run before everything else
actual_target:
@echo real work happens here