Skip to content

Instantly share code, notes, and snippets.

View jasnow's full-sized avatar
🏠
Working from home

Al Snow jasnow

🏠
Working from home
View GitHub Profile
@jasnow
jasnow / gist:1968592
Created March 3, 2012 22:12
Rubinius "rake install" regexp warning error
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for mmap... yes
checking for sys/mman.h... (cached) yes
checking for mmap... (cached) yes
checking whether read-only mmap of a plain file works... yes
checking whether mmap from /dev/zero works... no
checking for MAP_ANON(YMOUS)... yes
checking whether mmap with MAP_ANON(YMOUS) works... yes
@jasnow
jasnow / rubinius-more-warning-errors
Created March 6, 2012 01:29
Rubinius "rake install" more warning errors
/usr/include/c++/4.0.0/tr1/hashtable: In copy constructor ‘std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, mutable_iterators, unique_keys>::hashtable(const std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, mutable_iterators, unique_keys>&) [with Key = rubinius::InlineCache*, Value = rubinius::InlineCache*, Allocator = std::allocator<rubinius::InlineCache*>, ExtractKey = Internal::identity<rubinius::InlineCache*>, Equal = std::equal_to<rubinius::InlineCache*>, H1 = std::tr1::hash<rubinius::InlineCache*>, H2 = Internal::mod_range_hashing, H = Internal::default_ranged_hash, RehashPolicy = Internal::prime_rehash_policy, bool cache_hash_code = false, bool mutable_iterators = false, bool unique_keys = true]’:
/usr/include/c++/4.0.0/tr1/unordered_set:56: instantiated from ‘typename Pair::second_type& Internal::map_base<K, Pair, Internal::extract1st<Pair>, true, Hashtable>::operator[](const K&) [with K = ru
@jasnow
jasnow / gist:3715876
Created September 13, 2012 17:11
Ran ror_ecommerce's "rake" command.
$ rake 2>&1 |tee o_rake
/Users/whitemac/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -S rspec ./spec/controllers/abouts_controller_spec.rb ./spec/controllers/admin/config/accounts_controller_spec.rb ./spec/controllers/admin/config/overviews_controller_spec.rb ./spec/controllers/admin/config/shipping_categories_controller_spec.rb ./spec/controllers/admin/config/shipping_methods_controller_spec.rb ./spec/controllers/admin/config/shipping_rates_controller_spec.rb ./spec/controllers/admin/config/shipping_zones_controller_spec.rb ./spec/controllers/admin/config/tax_categories_controller_spec.rb ./spec/controllers/admin/config/tax_rates_controller_spec.rb ./spec/controllers/admin/document/invoices_controller_spec.rb ./spec/controllers/admin/fulfillment/comments_controller_spec.rb ./spec/controllers/admin/generic/coupons_controller_spec.rb ./spec/controllers/admin/generic/deals_controller_spec.rb ./spec/controllers/admin/help_controller_spec.rb ./spec/controllers/admin/history/addresses_controller_spec.rb ./spec/controllers
1. Add this line to Gemfile:
* gem "database_cleaner", :git => 'git://github.com/bmabey/database_cleaner.git'
2. Add these lines to spec/spec_helper.rb.
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
@jasnow
jasnow / gist:5909022
Created July 2, 2013 12:52
Day 5 Scripts
==> day5_nethttp1.rb <==
# nethttp1.rb
require 'net/http'
url = URI.parse('http://ruby-metaprogramming.rubylearning.com/html/ruby_metaprogramming_1.html')
Net::HTTP.start(url.host, url.port) do |http|
req = Net::HTTP::Get.new(url.path)
puts http.request(req).body.split(/\W+/).count('the')
end
@jasnow
jasnow / gist:5909443
Created July 2, 2013 13:49
Day 6 script
my_rack_proc = lambda { |env| [200, {"Content-Type" => "text/plain"}, ["Command line argument you typed was: #{ARGV[0]}"]] }
puts my_rack_proc.call({})
@jasnow
jasnow / gist:7347941
Created November 7, 2013 02:28
wraith config.yaml file (11/6/2013)
#Headless browser option
browser:
webkit: "phantomjs"
# gecko: "./slimerjs"
#If you want to have multiple snapping files, set the file name here
snap_file: "snap.js"
# Type the name of the directory that shots will be stored in
directory:
@jasnow
jasnow / gallery.html
Last active December 27, 2015 15:29
wraith's gallery.html file (11/6/2013)
@jasnow
jasnow / gist:7725323
Created November 30, 2013 22:12
PC Medlink "$HOME/count-commits" on 11/30/2013 at 5:12pm
527 Al Snow
247 James Dabbs
60 Clint Lee
59 Patrick Stoica
59 Gordon Macie
48 Diane Deseta
39 Jonathan Howard
34 Chenheli Hua
27 Jake Swanson
9 Gerry Pass
@jasnow
jasnow / 24pr-ruby-bug-gist
Created December 27, 2013 15:54
5 failed 24pullrequest.com rspecs after Ruby 2.1 upgrade
This file has been truncated, but you can view the full file.
===== rspec spec/controllers/gifts_controller_spec.rb ==========
./home/dell/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/inheritance.rb:27: [BUG] Segmentation fault at 0x00000c
ruby 2.1.0p0 (2013-12-25 revision 44422) [i686-linux]
-- Control frame information -----------------------------------------------
c:0061 p:0109 s:0284 e:000281 METHOD /home/dell/.rvm/gems/ruby-2.1.0/gems/activerecord-4.0.2/lib/active_record/inheritance.rb:27 [FINISH]
c:0060 p:---- s:0275 e:000274 CFUNC :call
c:0059 p:0017 s:0271 e:000270 METHOD /home/dell/Projects/24pullrequests/app/models/user.rb:171
c:0058 p:0020 s:0266 e:000263 METHOD /home/dell/Projects/24pullrequests/app/controllers/gifts_controller.rb:11
c:0057 p:0014 s:0260 e:000259 METHOD /home/dell/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_controller/metal/implicit_render.rb:4