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 / gist:5619920
Created May 21, 2013 13:51
FizzBuzz Attempt for #spreeconf
(1..100).each do |n|
n = 'fizzbuzz' if n % 15 == 0
n = 'fizz' if n % 3 == 0
n = 'buzz' if n % 5 == 0
puts n
end
-------------
1
@cmar
cmar / gist:5952531
Created July 8, 2013 21:11
Ruby LoCo Hack Night Challenge #1
#!/usr/bin/env ruby
#
# Ruby LoCo Hack Night Challenge #1
require 'benchmark'
a = [1, 2, 3, 4, 5]
b = [2, 5, 1, 3, 4]
# write a program to match indexes from a to b
require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
@cmar
cmar / -
Created July 25, 2013 17:25
it 'subscribes new users to a mailing list' do
@usps.should_receive(:picked_up?).with('EJ958083578US').and_return(true)
post '/pickup_check', message.to_json, auth
last_response.status.should == 200
json = JSON.parse last_response.body
json['message_id'].should eq 'abc'
json['messages'].first['message'].should eq 'shipment:dispatch'
json['messages'].first['payload']['shipment_number'].should eq 'H12345678901'
@cmar
cmar / gist:7884029
Created December 10, 2013 00:56
Connect 4 from RubyLoCo Hack NIght
require 'pry'
class Board
def initialize
@columns = []
7.times do
@columns << Array.new(6, '_')
end
end
@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: