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
@dariusk
dariusk / autocharts.js
Created July 8, 2014 18:36
Code snippet from @autocharts with an explanation
// I search twitter for the following strings. I'm looking specifically for questions that start with
// 'do you' or 'are you', but do not contain certain key words.
_.when(
search('"do you" -what -why -who -where -which -when -how'),
search('"are you" -what -why -who -where -which -when -how')
)
.done(function(doYou,areYou) {
// I take the raw search results and I snip away
// the "do you" or "are you" and just grab the rest of the sentence. So "Are you a magician?" becomes
// "a magician". I collect a bunch of these. (I strip away "what" and similar, because "what are you
@kach
kach / Lua.ne
Created April 18, 2014 04:12
A Lua grammar for nearley
# Adapted from http://www.lua.org/manual/5.2/manual.html
# No comments implemented yet, because lua comments are hard.
Chunk -> _ Block _
Block -> _Block
| _Block __ ReturnStat
ReturnStat -> "return" __ ExpList
| "return" __ ExpList _ ";"
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 16, 2024 13:44
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@eraserhd
eraserhd / splay-rope.clj
Created January 22, 2014 15:28
A rope implementation using splay trees.
(ns splay-rope.core)
(declare traverse)
(deftype Node [^int offset
^String data
left
right]
Object
(toString [node]
@jcs
jcs / gist:5573685
Last active April 2, 2024 20:18
macOS FileVault encryption and OpenBSD encrypted softraid on a Macbook Air/Pro

Update (2019-05-06): The Broadcom wireless card in the MacBook Pro works and can be crammed into the Air.

Update (2015-12-04): This document used to be very lengthy as there were many manual steps required to get OpenBSD and Mac OS X working together through Boot Camp Assistant (BCA), which created a hybrid MBR and enabled a legacy BIOS emulation mode which older versions of Windows (and OpenBSD) required. Newer Macbooks stopped supporting older versions of Windows through BCA and now only support Windows 10 since it uses GPT and UEFI. However, now that newer versions of OpenBSD support GPT and UEFI, Boot Camp Assistant is no longer needed at all to boot OpenBSD.

macOS FileVault encryption and OpenBSD encrypted softraid on a Macbook Air/Pro

OpenBSD works pretty well on at least the Mid-2011 Macbook Air (A1370, SandyBridge) and Mid-2013 Macbook Air (Haswell). The new KMS code in 5.4 brings up the MBA's eDP display in 1366x768 with backlight

@sw17ch
sw17ch / Makefile
Last active December 10, 2015 13:08
main: main.c shim.o
shim.o: foo.c foo_shim.c foo.h
#
# Compile Files
gcc foo.c -c -o foo.o
gcc foo_shim.c -c -o foo_shim.o
#
# Rename the symbol we care about: foo -> old_foo
objcopy --redefine-sym foo=old_foo foo.o _foo.o
#