Skip to content

Instantly share code, notes, and snippets.

View BDQ's full-sized avatar
💥

Brian Quinn BDQ

💥
View GitHub Profile
@BDQ
BDQ / bash.sh
Created November 16, 2012 10:55
Foreman - bluepill - custom template
bundle exec foreman export bluepill --template=/data/bluepill/ /etc/init
apt-get install ufw -y
ufw allow ssh/tcp
ufw allow 80
ufw allow 443
ufw logging on
ufw enable
Generating dummy Rails application...
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
Setting up dummy database...
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
Generating dummy Rails application...
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
Setting up dummy database...
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
Generating dummy Rails application...
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
p = Spree::Product.find_by_name('Ruby on Rails Bag')
si = p.master.stock_items.first
si.update_attribute(:count_on_hand, 0)
sl = Spree::StockLocation.create(name: 'Second Location')
sl.stock_items.create(variant: p.master, count_on_hand: 10)
sl.active = true
sl.save!
@BDQ
BDQ / development.log
Last active December 15, 2015 18:19
line_item.destroy with after_commit callback
(0.1ms) begin transaction
Spree::Adjustment Load (0.1ms) SELECT "spree_adjustments".* FROM "spree_adjustments" WHERE "spree_adjustments"."adjustable_id" = 9 AND "spree_adjustments"."adjustable_type" = 'Spree::LineItem'
Spree::Order Load (0.1ms) SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."id" = 3 LIMIT 1
Spree::InventoryUnit Load (0.1ms) SELECT "spree_inventory_units".* FROM "spree_inventory_units" WHERE "spree_inventory_units"."order_id" = 3
SQL (0.3ms) DELETE FROM "spree_line_items" WHERE "spree_line_items"."id" = ? [["id", 9]]
(1.1ms) commit transaction
Spree::Adjustment Load (0.1ms) SELECT "spree_adjustments".* FROM "spree_adjustments" WHERE "spree_adjustments"."adjustable_id" = 3 AND "spree_adjustments"."adjustable_type" = 'Spree::Order' AND "spree_adjustments"."originator_type" = 'Spree::TaxRate' AND "spree_adjustments"."adjustable_type" = 'Spree::Order' ORDER BY created_at ASC
Spree::LineItem Load (0.1ms) SELECT "spree_line_items".* FROM "spree_line_items" W
@BDQ
BDQ / development.log
Last active December 15, 2015 18:19
line_item.destroy using after_destroy callback (stock 1-3-stable)
(0.1ms) begin transaction
Spree::Adjustment Load (0.1ms) SELECT "spree_adjustments".* FROM "spree_adjustments" WHERE "spree_adjustments"."adjustable_id" = 10 AND "spree_adjustments"."adjustable_type" = 'Spree::LineItem'
Spree::Order Load (0.1ms) SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."id" = 3 LIMIT 1
Spree::InventoryUnit Load (0.1ms) SELECT "spree_inventory_units".* FROM "spree_inventory_units" WHERE "spree_inventory_units"."order_id" = 3
SQL (0.2ms) DELETE FROM "spree_line_items" WHERE "spree_line_items"."id" = ? [["id", 10]]
Spree::Adjustment Load (0.1ms) SELECT "spree_adjustments".* FROM "spree_adjustments" WHERE "spree_adjustments"."adjustable_id" = 3 AND "spree_adjustments"."adjustable_type" = 'Spree::Order' AND "spree_adjustments"."originator_type" = 'Spree::TaxRate' AND "spree_adjustments"."adjustable_type" = 'Spree::Order' ORDER BY created_at ASC
Spree::LineItem Load (0.1ms) SELECT "spree_line_items".* FROM "spree_line_items" WHERE "spree_line_items"."o
=> Booting WEBrick
=> Rails 3.2.13 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-04-29 10:40:54] INFO WEBrick 1.3.1
[2013-04-29 10:40:54] INFO ruby 1.9.3 (2012-11-10) [x86_64-darwin12.2.0]
[2013-04-29 10:40:54] INFO WEBrick::HTTPServer#start: pid=14908 port=3000
Started GET "/" for 127.0.0.1 at 2013-04-29 10:45:54 +0100
Processing by Spree::HomeController#index as HTML
Deface: 2 overrides found for 'spree/layouts/spree_application'
@BDQ
BDQ / gist:5583170
Last active December 17, 2015 08:49
SpreeConf: Spree Integrator Demo steps
git clone [email protected]:BDQ/demo_endpoint.git
cd demo_endpoint
bundle install
bundle exec rackup -s thin -p 9000
@BDQ
BDQ / resource.js
Last active December 17, 2015 19:49 — forked from LBRapid/resource.js
var resource;
resource = railsResourceFactory({
url: '/api/registrations',
name: 'registration'
availableKeys: function(){
return this.$get(this.$url() + '/available_keys');
}
});
ActionView::Template::Error (undefined method `[]' for nil:NilClass):
1: json.message_id @message['message_id']
2: json.locked do
3: json.number @locked_order['number']
4: json.locked_at 'locked_at'
app/views/orders/lock/consume.json.jbuilder:1:in `_app_views_orders_lock_consume_json_jbuilder___3235425158690258864_28771100'
app/controllers/application_controller.rb:14:in `authorize'