Skip to content

Instantly share code, notes, and snippets.


Matt Burke spraints

View GitHub Profile
View count-line-endings.rb
#/ Usage: ruby count-line-endings.rb file1 file2 ...
#/ Reports how many of each kind of line endings there are in the files.
ARGV.each do |file|, 'rb') do |f|
puts "#{file}:"
state = :none
dos = unix = mac = 0 do |c|
spraints / svn-commit.har
Created Mar 7, 2014
HTTP traffic from `svn commit`
View svn-commit.har
{"log": {"entries": [{"startedDateTime": "2014-03-07T12:26:48.955008+00:00", "cache": {}, "request": {"cookies": [], "postData": {"mimeType": "text/xml", "text": "<?xml version=\"1.0\" encoding=\"utf-8\"?><D:options xmlns:D=\"DAV:\"><D:activity-collection-set/></D:options>", "params": []}, "url": "", "queryString": [], "headers": [{"name": "User-Agent", "value": "SVN/1.7.13 neon/0.30.0"}, {"name": "Connection", "value": "TE"}, {"name": "TE", "value": "trailers"}, {"name": "Host", "value": ""}, {"name": "Content-Type", "value": "text/xml"}, {"name": "Accept-Encoding", "value": "gzip"}, {"name": "DAV", "value": ""}, {"name": "DAV", "value": ""}, {"name": "DAV", "value": ""}, {"name": "Content-Length", "value": "104"}, {"name": "Accept-Encoding", "value": "gzip"}], "headersSize": 379, "bodySize": 104, "method": "OPTIONS", "httpVe
#!/usr/bin/env python
import binascii, sys, json
from libmproxy import version, tnetstring, flow
from datetime import datetime
def create_har(flows):
return {
spraints / Gemfile
Last active Aug 29, 2015
Download some Adam and Burt Crime Fighting Adventures
View Gemfile
source ""
gem "nokogiri"
gem "typhoeus", ">= 0.6.7"

Keybase proof

I hereby claim:

  • I am spraints on github.
  • I am spraints ( on keybase.
  • I have a public key whose fingerprint is 5D65 6C96 2103 C534 1282 4BEC 02AC 7D12 4E49 60B7

To claim this, I am signing this object:

View example-svn-info.xml
<?xml version="1.0" encoding="UTF-8"?>
View docker-aufs-fsck.rb
#/ Usage: sudo ruby docker-aufs-fsck.rb
#/ Your docker aufs storage will be checked for orphaned or missing layers.
def main
aufs_root = find_aufs_root
die "Could not find aufs root!" if aufs_root.nil?
fsck ={
:images => `docker images -a -q --no-trunc`.split(/\s+/),
:containers => `docker ps -a -q --no-trunc`.split(/\s+/),
View compounding.rb
# To demonstrate what a "Bank of Dad" would be like
require "date"
birthday = # replace this with the child's birthday
twentyone = 21.times.inject(birthday) { |d, _| d.next_year }
balance = 0.0
View quiet.rb
def process(pull, attributes)
pull.review_comments.find_each do |comment|
comment.updated_at = comment.created_at # fix for referred_at
quiesce(comment, :ensure_synced_with_pull) do
issue_post_processor.process(pull.issue, attributes)
View graceful
#!/bin/sh -x
httpd -f /Users/burke/github/svn_apache/httpd.conf -k `basename $0`