This file contains hidden or 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/cmar/Code/ci/rails_frontend/.bundle/ruby/1.9.1/gems/activerecord-3.2.17/lib/active_record/attribute_assignment.rb:33:in `attributes=': wrong number of arguments (2 for 1) (ArgumentError) | |
| from /Users/cmar/Code/ci/rails_frontend/lib/tools/record_copy.rb:85:in `create_copy' | |
| from /Users/cmar/Code/ci/rails_frontend/lib/tools/record_copy.rb:62:in `block (2 levels) in copy' | |
| from /Users/cmar/Code/ci/rails_frontend/lib/tools/record_copy.rb:61:in `each' | |
| from /Users/cmar/Code/ci/rails_frontend/lib/tools/record_copy.rb:61:in `block in copy' | |
| from /Users/cmar/Code/ci/rails_frontend/lib/tools/record_copy.rb:76:in `block in write_copy_mode' | |
| from /Users/cmar/Code/ci/rails_frontend/.bundle/ruby/1.9.1/gems/activerecord-oracle_enhanced-adapter-1.4.1/lib/active_record/connection_adapters/oracle_enhanced_schema_statements_ext.rb:208:in `disable_referential_integrity' | |
| from /Users/cmar/Code/ci/rails_frontend/lib/tools/record_copy.rb:68:in `write_copy_mode' | |
| from /Users/cmar/Code/ci/rails_frontend/lib/tools/record_copy. |
This file contains hidden or 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 | |
| # | |
| # builds database of NFL players | |
| # | |
| # Ruby script to parse the nfl.com/teams to build a list of teams | |
| # then create a thread to parse each team roster | |
| # | |
| # This creates 32 threads, each appending to the all_players array | |
| # it works well in ruby mri because of the global interpreter lock | |
| # |
This file contains hidden or 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
| task :default do |task| | |
| file_list = FileList['*.jpg', '*.png', '*.gif', '*.mov', '*.mp4'] | |
| file_list.each do |file| | |
| year = file[/^\d{4}/] | |
| month = file[/(?<=^\d{4}-)\d{2}/] | |
| directory = File.join year, month | |
| mkdir_p directory | |
| mv file, directory |
This file contains hidden or 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
| # each_with_index, each_with_object and inject({}) are all %50 slower then #each | |
| # simple each with an addition noop | |
| [4] pry(main)> puts Benchmark.measure { (1..10_000_000).each { |i| i + 1 } } | |
| 0.450000 0.000000 0.450000 ( 0.448808) | |
| # each_with_index | |
| [5] pry(main)> puts Benchmark.measure { (1..10_000_000).each_with_index { |i, index| i + 1 } } | |
| 0.650000 0.000000 0.650000 ( 0.645812) |
This file contains hidden or 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
| /gems/activemodel-3.2.13/lib/active_model/attribute_methods.rb:407 in "method_missing" | |
| /gems/activerecord-3.2.13/lib/active_record/attribute_methods.rb:149 in "method_missing" | |
| /app/models/delivery_method.rb:130 in "original_order_by" | |
| /app/models/delivery_method.rb:165 in "order_by_has_passed?" | |
| /app/models/delivery_method.rb:72 in "date" | |
| /app/models/delivery.rb:109 in "delivery_dates" | |
| /app/serializers/delivery_serializer.rb:12 in "delivery_dates" | |
| (eval):6 in "_fast_attributes" | |
| /gems/active_model_serializers-0.8.1/lib/active_model/serializer.rb:466 in "rescue in attributes" | |
| /gems/active_model_serializers-0.8.1/lib/active_model/serializer.rb:454 in "attributes" |
This file contains hidden or 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
| # if you have a directory of files that look like: | |
| # 2015-03-21 11.23.39.jpg | |
| # 2015-04-15 09.55.20.jpg | |
| # 2015-03-21 11.23.42.jpg | |
| # 2015-05-12 13.14.59.png | |
| # | |
| # this Rakefile will move all the files into subdirectories for year/month | |
| task :default do |task| | |
| file_list = FileList['*.jpg', '*.png'] |
This file contains hidden or 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 | |
| # | |
| # This goal of this RubyLoCo Puzzle is to generate an ascii | |
| # American Flag. Try to come up with a unique way to generate | |
| # the flag. Below is the easiest implementation. | |
| # | |
| # Ruby not required! Use any langauge and pair up! | |
| # | |
| # If you complete the task here are some more advanced ideas: | |
| # make the flag colored |
This file contains hidden or 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 | |
| # RubyLoCo Star Wars Hack Night | |
| # Documentation https://swapi.co/documentation | |
| require 'bundler/inline' | |
| # true to install gems | |
| gemfile false do | |
| source 'https://rubygems.org' | |
| gem 'httparty' |
This file contains hidden or 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 | |
| # RubyLoCo Star Wars Hack Night | |
| # Documentation https://swapi.co/documentation | |
| require 'json' | |
| require 'bundler/inline' | |
| # true to install gems | |
| gemfile ENV['INSTALL'] do | |
| source 'https://rubygems.org' | |
| gem 'typhoeus' |
This file contains hidden or 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
| # $ rails new thud -m https://gist.github.com/radar/722911/raw/ | |
| gem "rspec-rails", group: "test" | |
| gem "pry" | |
| gem "devise" |