Skip to content

Instantly share code, notes, and snippets.

View resistorsoftware's full-sized avatar

David Lazar resistorsoftware

View GitHub Profile
@resistorsoftware
resistorsoftware / Gemfile
Created July 28, 2014 15:26
Unicorn setup
source 'https://rubygems.org'
ruby '2.1.2'
gem "sinatra", :require => 'sinatra/base'
gem "sinatra-flash", :require => "sinatra/flash"
gem "haml"
gem "warden"
gem "unicorn"
gem 'activerecord', "~> 4.0", :require => 'active_record'
gem 'actionmailer', "~> 4.0", :require => 'action_mailer'
COST for border-trim-shirt = 22.34
Before: {}
Existing price object so merge... 22.34
After: {"S4221-XS"=>"22.34", "1082756904"=>"22.34"}
COST for border-trim-shirt = 22.34
Before: {"S4221-XS"=>"22.34", "1082756904"=>"22.34"}
Existing price object so merge... 22.34
After: {"S4221-XS"=>"22.34", "1082756904"=>"22.34", "S4221-S"=>"22.34", "1126176744"=>"22.34"}
COST for border-trim-shirt = 22.34
Before: {"S4221-S"=>"22.34", "S4221-XS"=>"22.34", "1082756904"=>"22.34", "1126176744"=>"22.34"}
@resistorsoftware
resistorsoftware / gist:ac4351616b729dcc224c
Last active August 29, 2015 14:15
Problem with DJ and ActiveModel
app error: undefined method `bytesize' for #<DelayedJob:0x007f063c9a0dc8> (NoMethodError)
/app/vendor/bundle/ruby/2.1.0/gems/activemodel-4.2.0/lib/active_model/attribute_methods.rb:433:in `method_missing'
/app/vendor/bundle/ruby/2.1.0/gems/rack-1.6.0/lib/rack/utils.rb:361:in `bytesize'
/app/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:152:in `block in finish'
/app/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:152:in `each'
/app/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:152:in `inject'
/app/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:152:in `finish'
/app/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:909:in `call!'
/app/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
/app/vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.9.275/lib/new_relic/rack/browser_monitoring.rb:23:in `traced_call'
@resistorsoftware
resistorsoftware / gist:b974409af75703542bf3
Created July 3, 2015 14:50
Problems with Shopify Discount Reporting
Raw Data From a Sale
[{
"gift_card"=>false,
"id"=>1646486209,
"price"=>"439.00",
"product_id"=>417517185,
"quantity"=>1,
"taxable"=>true,
"title"=>"something",
require 'toto'
require 'config/environment'
#point to your rails apps /public directory
use Rack::Static, :urls => ['/stylesheets', '/javascripts', '/images', '/favicon.ico'], :root => 'public'
use Rack::ShowExceptions
use Rack::CommonLogger
//Recommended Blueprint configuration with scoping and semantic layout:
+blueprint-utilities
+blueprint-debug
+blueprint-typography
//+blueprint-scaffolding
+sticky-footer(20px, "#container", "#root_footer", "#footer" )
body#site
#container
+container
%body#site
#container
#header
%h1 Foobar
#loading= image_tag("ajax-loader.gif")
#sidebar &nbsp;
#content= yield
#root_footer
#footer &copy; 2010 Foobar O-Rama
set :application, "foo"
set :repository, "git@github.com:foo/foobar.git"
set :scm, :git
role :web, "dev.foo.com" # Your HTTP server, Apache/etc
role :app, "dev.foo.com" # This may be the same as your `Web` server
role :db, "dev.foo.com", :primary => true # This is where Rails migrations will run
cap deploy:update
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote git@github.com:foo/foobar.git HEAD"
* executing "git clone -q git@github.com:foo/foobar.git dev/releases/20100527171357 && cd dev/releases/20100527171357 && git checkout -q -b deploy 6aa26ee969e86d6a7d7009e0d32b433de046b7d1 && (echo 6aa26ee969e86d6a7d7009e0d32b433de046b7d1 > dev/releases/20100527171357/REVISION)"
servers: ["dev.foo.com"]
[dev.foo.com] executing command
** [dev.foo.com :: err] sh: dev/releases/20100527171357/REVISION: No such file or directory
command finished
development:
adapter: postgresql
database: urbanaut_dev
username: uta
password: foo
test:
adapter: postgresql
database: urbanaut_test
username: uta