Skip to content

Instantly share code, notes, and snippets.

fbolt-web_1 | Started GET "/technologies/x-carve" for 172.18.0.13 at 2019-05-16 15:48:00 +0000
fbolt-web_1 | Started GET "/technologies/x-carve" for 172.18.0.13 at 2019-05-16 15:48:00 +0000
fbolt-web_1 | DEPRECATION WARNING: Calling #scope or #default_scope with a hash is deprecated. Please use a lambda containing a scope. E.g. scope :red, -> { where(color: 'red') }. (called from included at /usr/src/app/lib/restricted_scope.rb:5)
fbolt-web_1 | DEPRECATION WARNING: Calling #scope or #default_scope with a hash is deprecated. Please use a lambda containing a scope. E.g. scope :red, -> { where(color: 'red') }. (called from included at /usr/src/app/lib/restricted_scope.rb:5)
fbolt-web_1 | DEPRECATION WARNING: The following options in your Technology.has_many :technology_actions declaration are deprecated: :order. Please use a scope block instead. For example, the following:
fbolt-web_1 |
fbolt-web_1 | has
@kmarcisz
kmarcisz / clipper.js
Last active February 14, 2019 02:16 — forked from nevernormal1/clipper.js
Easel helper functions. Download this as a zip file and add dependencies to your app.
// rev 452
/********************************************************************************
* *
* Author : Angus Johnson *
* Version : 6.1.3a *
* Date : 22 January 2014 *
* Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-2014 *
* *
* License: *
mysql> show variables like 'character_set_server';
+----------------------+--------+
| Variable_name | Value |
+----------------------+--------+
| character_set_server | latin1 |
+----------------------+--------+
1 row in set (0.00 sec)
mysql> SELECT @@sql_mode;
+------------+
| @@sql_mode |
+------------+
| |
+------------+
1 row in set (0.00 sec)
mysql> SELECT @@global.sql_mode;
+-------------------+
mysql> select ENGINE, TABLE_NAME,Round( DATA_LENGTH/1024/1024) as data_length , round(INDEX_LENGTH/1024/1024) as index_length, round(DATA_FREE/ 1024/1024) as data_free from information_schema.tables where DATA_FREE > 0;
+--------+-------------------------------------+-------------+--------------+-----------+
| ENGINE | TABLE_NAME | data_length | index_length | data_free |
+--------+-------------------------------------+-------------+--------------+-----------+
| InnoDB | addresses | 50 | 0 | 7 |
| InnoDB | affiliate_referrals | 84 | 14 | 6 |
| InnoDB | answers | 8 | 1 | 4 |
| InnoDB | backorder_notification_items | 3 | 2 | 4 |
| InnoDB | backorder_notifications | 2 | 1 | 4 |
| InnoDB | bundle_component_order_items | 497 | 180 |
# Database structure
-- auto-generated definition
create table workpieces
(
id serial not null
constraint workpieces_pkey
primary key,
project_id integer,
carve_count integer,
position integer,
@kmarcisz
kmarcisz / easel-postgres-update.md
Last active October 27, 2018 13:47
easel-postgres-update.md

Note that all commands should be run locally unless otherwise noted.

Turn maintenance mode on on Easel

bundle exec cap production maintenance:start

Take a database snapshot

module VoucherifySupport
def self.discount_amount(voucher_code, order_or_cart)
voucher_params = order_or_cart.is_a?(Order) ? params_for_order(order_or_cart) : params_for_cart(order_or_cart)
validation_response = default_client.validations.validate_voucher(voucher_code, voucher_params)
if validation_response['valid']
get_discount_amount(validation_response, order_or_cart)
else
raise "Could not apply voucher, #{validation_response['reason']}"
deleted = []
orders = {
'jp0f9w5w' => ['30622-06'],
#'n0pke5nq' => ['30622-06', '30706-03', '30675-02', '30739-02'],
'C50L-DA2R' => ['30622-06'],
'C2OX-9I1R' => ['30622-06', '30706-03'],
'55jmrqp8' => ['30622-06', '30706-03', '30675-02'],
'1C3A-GFYN' => ['30622-06'],
'mefhy35n' => ['30622-06', '30784-02', '30675-02'],
results = []
exceptions = []
api_client = RedStag::API.default_client
CSV.foreach('tmp/tpfo.csv', :headers => true) do |row|
id = row['id']
fulfillment_location_id = row['fulfillment_location_id']
order_id = row['order_id']
third_party_fulfillment_id = row['third_party_fulfillment_id']