I hereby claim:
- I am spraints on github.
- I am spraints (https://keybase.io/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:
I hereby claim:
To claim this, I am signing this object:
source "https://rubygems.org" | |
gem "nokogiri" | |
gem "typhoeus", ">= 0.6.7" |
{"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": "http://svn.dev/svn/trunk", "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": "svn.dev"}, {"name": "Content-Type", "value": "text/xml"}, {"name": "Accept-Encoding", "value": "gzip"}, {"name": "DAV", "value": "http://subversion.tigris.org/xmlns/dav/svn/depth"}, {"name": "DAV", "value": "http://subversion.tigris.org/xmlns/dav/svn/mergeinfo"}, {"name": "DAV", "value": "http://subversion.tigris.org/xmlns/dav/svn/log-revprops"}, {"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 { | |
"log":{ |
#/ 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| | |
File.open(file, 'rb') do |f| | |
puts "#{file}:" | |
state = :none | |
dos = unix = mac = 0 | |
f.read.each_char do |c| |
#/ Usage: ruby timeout.rb <seconds> -- command arg arg arg | |
timeout, separator, *command = ARGV | |
timeout = timeout.to_f | |
if timeout <= 0.0 || separator != '--' || command.empty? | |
system "cat #$0 | grep ^#/ | cut -c4-" | |
exit 1 | |
end | |
trap(:CHLD) { exit 0 } |
source 'https://rubygems.org' | |
# Graph memory use. | |
gem 'stripmem' | |
gem 'typhoeus', :git => 'https://github.com/spraints/typhoeus', :ref => 'stream' | |
gem 'ethon', :git => 'https://github.com/spraints/ethon', :ref => 'streaming' | |
gem 'em-http-request' |
worker_pool 6 | |
queue '*' | |
before_fork do | |
require File.expand_path('config/environment') | |
Rails.application.eager_load! | |
ActiveRecord::Base.connection.disconnect! | |
end |
# add this to app/controllers/application_controller.rb: | |
def cache | |
options = { | |
'no-store' => 'no-store', | |
'no-cache' => 'no-cache', | |
'zero-age' => 'max-age=0', | |
} | |
if cc = options[params[:id]] | |
headers['Cache-Control'] = cc | |
end |
require 'multi_json' | |
require 'stringio' | |
require 'zlib' | |
def gz(infile) | |
outfile = infile + '.gz' | |
File.open(outfile, 'w') do |f| | |
f << `gzip -9 -c #{infile}` | |
end | |
outfile |