Skip to content

Instantly share code, notes, and snippets.

David Lazar resistorsoftware

Block or report user

Report or block resistorsoftware

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@resistorsoftware
resistorsoftware / gist:b974409af75703542bf3
Created Jul 3, 2015
Problems with Shopify Discount Reporting
View gist:b974409af75703542bf3
Raw Data From a Sale
[{
"gift_card"=>false,
"id"=>1646486209,
"price"=>"439.00",
"product_id"=>417517185,
"quantity"=>1,
"taxable"=>true,
"title"=>"something",
@resistorsoftware
resistorsoftware / gist:ac4351616b729dcc224c
Last active Aug 29, 2015
Problem with DJ and ActiveModel
View gist:ac4351616b729dcc224c
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'
View gist:add8e5ac2caa904cfede
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"}
View Gemfile
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'
@resistorsoftware
resistorsoftware / gist:6353325
Created Aug 27, 2013
Some simple Ajax cart
View gist:6353325
<h1>Product.Liquid crap goes here... lalalalala whatever... </h1>
<script type="text/javascript">
// I hacked the Ajax API to add line item properties for a product too.
function addToCart() {
var item = DaveWuzHere.utils.popQueue();
if(item) {
if(item.properties) {
Shopify.api.addItemWithProperties(item.id, item.quantity, item.properties, addToCart);
View gist:5215969
<li class="cart-overview"><a href="/cart">MY BAG (2)</a>
<div class="arrow-down-cart"></div>
<div id="crt" style="overflow: hidden; display: none;">
<form action="/cart" method="post" id="cartform">
<div id="cart-item">
<div class="quick-cart-image">
<a href="/products/paint-it-red-animal-instinct-tunic-top-black-blue" title="paint it red animal instinct tunic/top - black/blue">
<img src="http://cdn.shopify.com/s/files/1/0071/3552/products/21MARCH-731_small.jpg?12137" alt="paint it red animal instinct tunic/top - black/blue">
</a>
</div>
@resistorsoftware
resistorsoftware / RamJet
Created Feb 19, 2013
What's the difference between these rows?
View RamJet
2/16/13 15:13 Mark Schuldt 11836 S 47th Street Papillion NE 68133 US (402) 391-6668 Mark Schuldt 11836 S 47th Street Papillion NE 68133 US (402) 391-6668 mschuldt3@cox.net 53J315654H276600V AVS: Y CVV2: M Visa uspsd 2.99 0 162.97 MBSB8G 8GB DDR3-1333 Kit for MacBook Pro 1 79.99 MBP8G 8GB DDR3-1066 Kit for MacBook Pro 1 79.99
2/16/13 15:13 Mark Schuldt 11836 S 47th Street Papillion NE 68133 US (402) 391-6668 Mark Schuldt 11836 S 47th Street Papillion NE 68133 US (402) 391-6668 mschuldt3@cox.net 8EY04456F2208274D AVS: Y CVV2: M Visa uspsd 2.99 0 162.97 MBSB8G 8GB DDR3-1333 Kit for MacBook Pro 1 79.99 MBP8G 8GB DDR3-1066 Kit for MacBook Pro 1 79.99
@resistorsoftware
resistorsoftware / gist:3927575
Created Oct 21, 2012
rvm pkg install openssl
View gist:3927575
rvm pkg install openssl
Fetching openssl-1.0.1c.tar.gz to /Users/dlazar/.rvm/archives
Extracting openssl-1.0.1c.tar.gz to /Users/dlazar/.rvm/src
Configuring openssl in /Users/dlazar/.rvm/src/openssl-1.0.1c.
Compiling openssl in /Users/dlazar/.rvm/src/openssl-1.0.1c.
Installing openssl to /Users/dlazar/.rvm/usr
Please note that it's required to reinstall all rubies:
rvm reinstall all --force
@resistorsoftware
resistorsoftware / gist:3927334
Created Oct 21, 2012
OpenSSL problems with Shopify
View gist:3927334
openssl s_client -CApath /etc/ssl/certs -showcerts -connect luxutest.myshopify.com:443
CONNECTED(00000003)
depth=0 /serialNumber=inVwoUGzj3duFEUBdzDQrbS2kO1qx0Vr/C=CA/ST=Ontario/L=Ottawa/O=Jaded Pixel Technologies Inc./CN=*.myshopify.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 /serialNumber=inVwoUGzj3duFEUBdzDQrbS2kO1qx0Vr/C=CA/ST=Ontario/L=Ottawa/O=Jaded Pixel Technologies Inc./CN=*.myshopify.com
verify error:num=27:certificate not trusted
verify return:1
depth=0 /serialNumber=inVwoUGzj3duFEUBdzDQrbS2kO1qx0Vr/C=CA/ST=Ontario/L=Ottawa/O=Jaded Pixel Technologies Inc./CN=*.myshopify.com
verify error:num=21:unable to verify the first certificate
View gist:3419497
☠$ brew install postgresql
==> Downloading http://ftp.postgresql.org/pub/source/v9.1.4/postgresql-9.1.4.tar.bz2
Already downloaded: /Users/fizzbuzz/Library/Caches/Homebrew/postgresql-9.1.4.tar.bz2
==> Patching
patching file src/pl/plpython/Makefile
patching file contrib/uuid-ossp/uuid-ossp.c
==> ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.1.4 --datadir=/usr/local/Cellar/postgresql/9.1.4/share/postgresql --docdir=/usr/local/Cellar/postgresql/9.1.4/share/doc/postgresql --enable-
checking build system type... x86_64-apple-darwin10.8.0
checking host system type... x86_64-apple-darwin10.8.0
checking which template to use... darwin
You can’t perform that action at this time.