Skip to content

Instantly share code, notes, and snippets.

View keybase.md

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 Mar 11, 2013
Parse JSON from a Secure URL using Ruby
View parse_json.rb
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 Jul 5, 2012
github scoring app
View README.md

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 Jun 21, 2012
USB 2_0 benchmark results
View results.txt
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
rsolr memory leak test
View rsolr_test.rb
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 Apr 26, 2012
Rabl: rake test:setup
View output.txt
*** 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 Apr 3, 2012
CarrierWave Uploader spec stubbing
View carrierwave.rb
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 Mar 15, 2012
rabl test results with failed rails2 tests
View rake test
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 Dec 14, 2011
Install ruby-debug19 for ruby-1-9-3
View ruby-debug19-install.sh
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
@databyte
databyte / upgrade_postgres_9.0-9.1.sh
Created Nov 29, 2011
Upgrade PostgreSQL from 9.0 to 9.1
View upgrade_postgres_9.0-9.1.sh
#!/bin/sh
#
# Upgrade PostgreSQL from 9.0 to 9.1
#
# by David Sommers
#
brew update postgres