Skip to content

Instantly share code, notes, and snippets.

Shane Hanna shanna

Block or report user

Report or block shanna

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

Keybase proof

I hereby claim:

  • I am shanna on github.
  • I am shanna ( on keybase.
  • I have a public key ASB7WctqxheSQaiFSOvDLCvRe47lFZMirPn1NQiv4ePUcQo

To claim this, I am signing this object:

shanna / main.c
Created Mar 6, 2017
Minimal webkit2gtk segfault on macOS runs on Linux.
View main.c
#include <webkit2/webkit2.h>
#include <JavaScriptCore/JavaScript.h>
int main(int argc, char **argv) {
gtk_init(&argc, &argv);
GtkWidget *main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
GtkWidget *webkit_view = webkit_web_view_new();
gtk_container_add(GTK_CONTAINER(main_window), webkit_view);
shanna / example.rb
Last active Feb 8, 2017
Jaccard coeff against shingles.
View example.rb
require 'shingles'
compare = %w{
foo foo
foo bar
baz boz
foofoo foobar
compare.each do |a, b|
shanna / brokenimage.js
Created Oct 19, 2016
Broken image JS.
View brokenimage.js
// MIT minus the jquery.
function BrokenImage(selector, options) {
'use strict';
options = options || {};
var defaults = {
timeout: 2500
for (var key in defaults) {
shanna / pg-install
Created Sep 6, 2016
Postgres install from source on OSX when homebrew won't give you a specific version.
View pg-install
#!/usr/bin/env bash
set -e
# Homebrew homebrew/versions was broken when I went to install postgres.
# This shell script just documents my install from source.
mkdir -p $prefix
shanna / psql-migrate
Last active May 23, 2016
Postgres migration script.
View psql-migrate
#!/usr/bin/env sh
set -eu
if [ $# -ne 0 ]; then
cat <<-USAGE
Takes a sorted list of filenames from stdin and writes psql migrations sql
to stdout.
shanna /
Last active May 4, 2016
A short, smart, prompt.
# [ -e ~/.config/ ] && source ~/.config/
__git_ps1() { PS1="$1$2"; }
[ -e ~/.config/ ] && source ~/.config/
__short_ps1() {
local exit=$?
local __short_ps1_host=""
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
shanna / go-env
Last active May 3, 2016
Symlink Go packages into local project directory.
View go-env
#!/usr/bin/env sh
# Setup Go environment.
# source ~/local/bin/go-env
__util_env_path_prepend() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
shanna / jlink
Created Oct 25, 2015
jlink wrapper script for debugging and flashing.
View jlink
shanna /
Last active Aug 29, 2015
BuildKite Systemd Target

BuildKite Systemd Target

Debian Jessie buildkite agent when networking is up.


You can’t perform that action at this time.