Skip to content

Instantly share code, notes, and snippets.

View spraints's full-sized avatar
🦦

Matt Burke spraints

🦦
View GitHub Profile

Hi Jim,

I'm writing about COVID-19. First of all, thank you for voting for the CARES Act in March. I think it's a necessary step towards getting the pandemic under control.

My main point in writing, though, is that I am extremely disappointed in the response of the federal government to the pandemic. There seems to be a lot of focus on the economic effects of the crisis. The economic effects are quite bad. But I think a lot of the emphasis on the economy is misplaced. Regardless of the official restrictions on activity, the economy will not recover as long as coronavirus transmission is still happening. Instead of focusing on re-opening the economy, we, as a nation, should be focused on eliminating the virus. When the threat of infection is gone, the economy will take care of itself.

States, including Indiana, are taking cues from the federal government. I think that Indiana is opening too soon, in large part because of the lack of strong leadership from the federal government. Please support measures that

@spraints
spraints / bigfiles.md
Created September 20, 2019 19:57
track down large files in your repo's history

First, get a list of all objects with their sizes.

git rev-list --all --objects | awk '{print $1}' | git cat-file --batch-check > obj-sizes.txt

Show the largest object size.

cat obj-sizes.txt | awk '{print $3}' | sort -n | tail -1
def show(x, y)
puts "#{y} #{y.to_f / x.to_f}"
end
a, b = ARGV.map(&:to_i)
c = a + b
puts a
show a, b
show b, c
50.times do
package main
import (
"fmt"
)
func main() {
try(&Owner{})
try(&Owner{org: &Organization{"group"}})
try(&Owner{user: &User{"person"}})
source "https://rubygems.org"
gem "mochilo", :git => "https://github.com/spraints/mochilo", :ref => "custom-type-registry"
gem "benchmark-ips"
@spraints
spraints / go.command
Last active April 13, 2017 00:26
Stitch a folder of images into a movie
#!/bin/bash
root=$(cd $(dirname "$0"); pwd)
cd $root
exec ruby process.rb "$@"
@spraints
spraints / bench-init.rb
Created October 5, 2016 12:13
benchmark a few styles of constructors in ruby
# I wanted to see how fast different constructor styles were.
#
# Calculating -------------------------------------
# splat 73.970k i/100ms
# manual splat 77.512k i/100ms
# kwarg 23.687k i/100ms
# attr 77.930k i/100ms
# opts 34.173k i/100ms
# fetch 29.289k i/100ms
# -------------------------------------------------
@spraints
spraints / .gitignore
Last active August 20, 2016 22:40
farmersmarket.com helpers
.bundle

I wanted to connect from a docker container on a prod server to an SVN server on my laptop today. The steps were tricky, so here they are:

ssh tunnel

Exposing the local port to the prod server is pretty straightforward

laptop$ ssh -R 4204:127.0.0.1:4204 myserver

docker networking