Skip to content

Instantly share code, notes, and snippets.

@databyte
databyte / upgrade_postgres_9.0-9.1.sh
Created November 29, 2011 03:29
Upgrade PostgreSQL from 9.0 to 9.1
#!/bin/sh
#
# Upgrade PostgreSQL from 9.0 to 9.1
#
# by David Sommers
#
brew update postgres

Keybase proof

I hereby claim:

  • I am databyte on github.
  • I am databyte (https://keybase.io/databyte) on keybase.
  • I have a public key ASBhhhPiq_gLAF_i3fBiqwXzsJjjR-7H1TIG_MxmyRnwVQo

To claim this, I am signing this object:

@databyte
databyte / parse_json.rb
Created March 11, 2013 21:19
Parse JSON from a Secure URL using Ruby
require "json"
require "net/https"
require "uri"
uri = URI.parse("https://github.com/databyte.json")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(uri.request_uri)
@databyte
databyte / README.md
Created July 5, 2012 13:27
github scoring app

Task:

Build a webapp where I can search for a GitHub user and see a score based on their activity.

Example URLs:

https://github.com/tenderlove.json
https://github.com/wycats.json
@databyte
databyte / results.txt
Created June 21, 2012 05:24
USB 2_0 benchmark results
Kingston DataTraveler 108
Results 2.94
System Info
Xbench Version 1.3
System Version 10.7.4 (11E53)
Physical RAM 8192 MB
Model MacBookPro8,2
Drive Type Kingston DataTraveler 108
Disk Test 2.94
@databyte
databyte / rsolr_test.rb
Created May 4, 2012 21:00
rsolr memory leak test
require 'rsolr'
require 'thread'
require 'optparse'
require 'ruby-debug'
require 'ruby-prof'
module Allocation
def self.count
GC.disable
before = ObjectSpace.count_objects
@databyte
databyte / output.txt
Created April 26, 2012 18:19
Rabl: rake test:setup
*** Setting up for padrino_test tests ***
Using rake (0.9.2.2)
Using multi_json (1.3.2)
Using activesupport (3.1.4)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.4)
Using arel (2.2.3)
Using tzinfo (0.3.33)
Using activerecord (3.1.4)
@databyte
databyte / carrierwave.rb
Created April 3, 2012 22:19
CarrierWave Uploader spec stubbing
CarrierWave::Uploader::Base.descendants.each do |klass|
next if klass.anonymous?
klass.class_eval do
def cache_dir
"#{Rails.root}/public/system/test/#{Process.pid.to_s}/tmp"
end
def store_dir
"#{Rails.root}/public/system/test/#{Process.pid.to_s}/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
@databyte
databyte / rake test
Created March 15, 2012 22:42
rabl test results with failed rails2 tests
hades ☯ ~/projects/rabl ‹1.9.3@rabl› ➤ b8434e0-master⚡
11085 ± $ rake test:fixtures ⏎ [8m] ✹ ✭ [18:40:27]
*** Running tests for padrino_test... ***
/Users/databyte/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -I"lib" -I"/Users/databyte/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib" "/Users/databyte/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb" "test/app/controllers/**/*_test.rb"
The Gemfile's dependencies are satisfied
....................................
36 passes, 0 failures, 0 errors in 0.551838 seconds
@databyte
databyte / ruby-debug19-install.sh
Created December 14, 2011 04:17
Install ruby-debug19 for ruby-1-9-3
wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
wget http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
gem install linecache19-0.5.13.gem
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rvm/src/ruby-1.9.3-p194
rm linecache19-0.5.13.gem
rm ruby-debug-base19-0.11.26.gem