Skip to content

Instantly share code, notes, and snippets.

View cmar's full-sized avatar

Chris Mar cmar

  • CustomInk
  • Northern, VA
  • X @cmar
View GitHub Profile
@cmar
cmar / -
Created February 13, 2014 13:50
rake aborted!
"DESC electronic_checks" failed; does it exist?
/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_connection.rb:76:in `describe'
/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_oci_connection.rb:213:in `rescue in describe'
/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_oci_connection.rb:208:in `describe'
/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_adapter.rb:1062:in `columns_without_cache'
/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_adapter.rb:1051:in `column
@cmar
cmar / -
Created March 10, 2014 13:57
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/cmar/.rubies/ruby-1.9.3-p545/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... yes
checking for sys/types.h... yes
@cmar
cmar / -
Created March 13, 2014 19:53
Script started on Thu Mar 13 15:52:22 2014
[?1034hrails_frontend (master)$ ag zip_codecd testrails cgrep request test/rfegrep request test/rails ccd testag zip_codertest test/capybara/lab_buynow_resave_test.rb -n "/choosing the resave option/"
Run options: -n "/choosing the resave option/"
# Running tests:
############################################################
{"color_counts"=>{"front"=>"0", "back"=>"0", "sleeve"=>"0"}, "redraw"=>"false", "items"=>[{"product_id"=>"04600", "sizes"=>{"YXS"=>"0", "YS"=>"0", "YM"=>"0", "YL"=>"0", "YXL"=>"0", "S"=>"0", "M"=>"0", "L"=>"0", "XL"=>"0", "XXL"=>"0", "XXXL"=>"0", "XXXXL"=>"undefined"}, "name_count"=>"0", "number_count"=>"0"}], "sponsorship"=>"false", "postal_code"=>"37130", "fullcolor1"=>"false", "fullcolor2"=>"false", "fullcolor3"=>"false", "options"=>{"validate_availability_of_sizes"=>true}}
------------------------------------------------------------
#<Qu
@cmar
cmar / gist:9624697
Created March 18, 2014 17:16
Keybase proof
### Keybase proof
I hereby claim:
* I am cmar on github.
* I am cmar (https://keybase.io/cmar) on keybase.
* I have a public key whose fingerprint is ADD4 38EB 6855 F600 0E5F BF1E 73CD 08A5 A955 422B
To claim this, I am signing this object:
@cmar
cmar / -
Created April 14, 2014 17:25
/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.
@cmar
cmar / nfl.rb
Created August 21, 2014 12:24
Build database of NFL Players using Ruby Threads
#!/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
#
@cmar
cmar / Rakefile
Created September 23, 2014 17:16
Dropbox Camera Uploads sorter
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
@cmar
cmar / -
Created January 5, 2015 15:03
/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"
@cmar
cmar / gist:abc9f1a708cd77968af8
Created June 16, 2015 18:40
Example Rakefile for managing photos
# 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']
@cmar
cmar / flag.rb
Last active August 29, 2015 14:24
RubyLoCo Hack Night Flag Puzzle
#!/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