This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
require 'open-uri' | |
require 'colorize' | |
class BikeScraper | |
BIKES_DIRECT_URL = 'http://www.bikesdirect.com/products/cross_bikes.htm' | |
TARGET_BIKE_SIZE_REGEX = /56cm/ | |
TARGET_BIKE_NAME = 'Fantom' | |
def execute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby-install --rubies-dir ~/.rvm/rubies rbx 2.2.10 | |
>>> Installing rbx 2.2.10 into /Users/jared/.rvm/rubies/rbx-2.2.10 ... | |
>>> Installing dependencies for rbx 2.2.10 ... | |
Warning: openssl-1.0.1j already installed | |
Warning: readline-6.3.8 already installed | |
Warning: libyaml-0.1.6 already installed | |
Warning: gdbm-1.11 already installed | |
>>> Downloading http://releases.rubini.us/rubinius-2.2.10.tar.bz2 into /Users/jared/src ... | |
>>> Verifying rubinius-2.2.10.tar.bz2 ... | |
>>> Extracting rubinius-2.2.10.tar.bz2 to /Users/jared/src/rubinius-2.2.10 ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"color_scheme": "Packages/User/idleFingers.tmTheme", | |
"draw_white_space": "selection", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
"*.pyc", | |
"*.pyo", | |
"*.exe", | |
"*.dll", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('select#user_school_id').select2 | |
minimumInputLength: 3 | |
placeholder: 'Search for Your School' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
file_to_minify = ARGV.first | |
system "java -jar /Users/jaredmehle/Documents/workspace/yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar #{file_to_minify} -o #{file_to_minify.split('.').first}-min.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to setup multiple heroku accounts | |
# (assuming you already have one setup) | |
# make sure ~/bin is in your path | |
create ~/bin/hcred and populate it with the following: | |
1 #!/usr/bin/env ruby | |
2 | |
3 `rm ~/.heroku/credentials` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run rake db:size to get a print of your database size in bytes. | |
# Run rake db:tables:size to get the sizes for individual tables | |
# Works for MySQL and PostgreSQL. Not tested elsewhere. | |
namespace :db do | |
desc 'Print data size for entire database' | |
task :size => :environment do | |
database_name = ActiveRecord::Base.connection.instance_variable_get("@config")[:database] | |
adapter = ActiveRecord::Base.connection.adapter_name.downcase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo tcpdump -i eth0 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Paperclip | |
module Dimension | |
def get_size_of(name, thumbnail=nil) | |
return '0x0' unless get_path_of(name, thumbnail) | |
Geometry.from_file(get_path_of(name, thumbnail)).to_s | |
end | |
# calculates width using processor | |
def get_width_of(name, thumbnail=nil) | |
return 0 unless get_path_of(name, thumbnail) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/builder.rb:138:in `method_missing' | |
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/builder.rb:116:in `send' | |
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/builder.rb:116:in `assign_attributes' | |
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/builder.rb:115:in `each_pair' | |
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/builder.rb:115:in `assign_attributes' | |
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/builder.rb:90:in `build' | |
/Users/jared/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/meta_search-15d49d18cde6/lib/meta_search/searches/active_record.rb:32:in `search' | |
app/controllers/north_star/properties_controller.rb:22:in `search' | |
actionpack (3.0.3) lib/action_controller/metal/implicit_rend |
OlderNewer