This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"request_id":"52f367367575e449c3000001","summary":"Order created in ShipStation: 90833246","order":{"id":"R154085346","shipstation_id":90833246}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"line_items": [ | |
{ | |
"product_id": "0300385BLK00M", | |
"name": "eve dress", | |
"quantity": 1, | |
"price": 198, | |
"image_url": "https://thereformation.com/rcms/media/3964/resize?size=60x60&tags=clp", | |
"properties": { | |
"color": "Black", | |
"size": "XS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Current time in hex (saves a few chars) | |
n = Time.now.to_i.to_s(16) | |
# Add some more random digits and convert to base24 (more entropy w/minimal chars) | |
n += rand(9999).to_s(24) | |
# Make sure the whole thing is exactly 10 chars | |
n.ljust(10).gsub(" ", "0") | |
# Convert to upcase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A simple script to backup an organization's GitHub repositories. | |
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files | |
GHBU_ORG=$GHBU_ORG # the GitHub organization whose repos will be backed up | |
GHBU_API=${GHBU_API-"https://api.github.com"} # base URI for the GitHub API | |
GHBU_GITHOST="github.com" # the GitHub hostname (see comments) | |
# I recommend using an API token so it is easily trackable and removable. | |
# Note that you MUST have SSH keys for a user with the access to all repos set up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# An example hook script to verify what is about to be committed. | |
# Called by git-commit with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# it wants to stop the commit. | |
# | |
# To enable this hook, rename this file to "pre-commit". | |
if git-rev-parse --verify HEAD > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Processing ProductsController#show (for 127.0.0.1 at 2009-11-15 17:55:52) [GET] | |
Parameters: {"action"=>"show", "id"=>"palmgard-grip-tack-lite-adult-football-lineman-gloves", "controller"=>"products"} | |
[4;36;1mProduct Load (0.9ms)[0m [0;1mSELECT * FROM `products` WHERE (`products`.`permalink` = 'palmgard-grip-tack-lite-adult-football-lineman-gloves') LIMIT 1[0m | |
Cache miss: Spree::Config ({}) | |
[4;35;1mPreference Load (0.4ms)[0m [0mSELECT * FROM `preferences` WHERE (`preferences`.owner_id = 1 AND `preferences`.owner_type = 'Configuration') [0m | |
[4;36;1mConfiguration Columns (1.2ms)[0m [0;1mSHOW FIELDS FROM `configurations`[0m | |
[4;35;1mConfiguration Load (0.2ms)[0m [0mSELECT * FROM `configurations` WHERE (`configurations`.`id` = 1) [0m | |
[4;36;1mCACHE (0.0ms)[0m [0;1mSELECT * FROM `configurations` WHERE (`configurations`.`id` = 1) [0m | |
[4;35;1mCACHE (0.0ms)[0m [0mSELECT * FROM `configurations` WHERE (`configurations`.`id` = 1) [0m | |
Cache write (will save 3.80ms): Spree::Config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Processing ProductsController#show (for 127.0.0.1 at 2009-11-15 17:55:52) [GET] | |
Parameters: {"action"=>"show", "id"=>"palmgard-grip-tack-lite-adult-football-lineman-gloves", "controller"=>"products"} | |
[4;36;1mProduct Load (0.9ms)[0m [0;1mSELECT * FROM `products` WHERE (`products`.`permalink` = 'palmgard-grip-tack-lite-adult-football-lineman-gloves') LIMIT 1[0m | |
Cache miss: Spree::Config ({}) | |
[4;35;1mPreference Load (0.4ms)[0m [0mSELECT * FROM `preferences` WHERE (`preferences`.owner_id = 1 AND `preferences`.owner_type = 'Configuration') [0m | |
[4;36;1mConfiguration Columns (1.2ms)[0m [0;1mSHOW FIELDS FROM `configurations`[0m | |
[4;35;1mConfiguration Load (0.2ms)[0m [0mSELECT * FROM `configurations` WHERE (`configurations`.`id` = 1) [0m | |
[4;36;1mCACHE (0.0ms)[0m [0;1mSELECT * FROM `configurations` WHERE (`configurations`.`id` = 1) [0m | |
[4;35;1mCACHE (0.0ms)[0m [0mSELECT * FROM `configurations` WHERE (`configurations`.`id` = 1) [0m | |
Cache write (will save 3.80ms): Spree::Config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -H "Content-Type:application/json" -H "Accept:application/json" -H "X-SpreeAPIKey: 164472af75abf6bb02a7b83ff1bed852852252b6" http://localhost:3000/api/orders | |
curl -H "Content-Type:application/json" -H "Accept:application/json" -H "X-SpreeAPIKey: 164472af75abf6bb02a7b83ff1bed852852252b6" http://localhost:3000/api/orders?search[number]=R664048424 --globoff -i | |
curl -H "Content-Type:application/json" -H "Accept:application/json" -H "X-SpreeAPIKey: 164472af75abf6bb02a7b83ff1bed852852252b6" | |
http://localhost:3000/api/orders/1035625630 | |
curl -H "Content-Type:application/json" -H "Accept:application/json" -H "X-SpreeAPIKey: 164472af75abf6bb02a7b83ff1bed852852252b6" http://localhost:3000/api/orders/1035625630/shipments | |
# create new shipment for order (assumes you know shipping method id - no inventory units) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -H "Content-Type:application/json" -H "Accept:application/json" -H "X-SpreeAPIKey: 164472af75abf6bb02a7b83ff1bed852852252b6" http://localhost:3000/api/orders | |
curl -H "Content-Type:application/json" -H "Accept:application/json" -H "X-SpreeAPIKey: 164472af75abf6bb02a7b83ff1bed852852252b6" http://localhost:3000/api/orders?search[number]=R664048424 --globoff -i | |
curl -H "Content-Type:application/json" -H "Accept:application/json" -H "X-SpreeAPIKey: 164472af75abf6bb02a7b83ff1bed852852252b6" | |
http://localhost:3000/api/orders/1035625630 | |
curl -H "Content-Type:application/json" -H "Accept:application/json" -H "X-SpreeAPIKey: 164472af75abf6bb02a7b83ff1bed852852252b6" http://localhost:3000/api/orders/1035625630/shipments | |
# create new shipment for order (assumes you know shipping method id - no inventory units) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shipment.class_eval do | |
def editable_by?(user) | |
%w(pending ready_to_ship unable_to_ship needs_fulfilment).include?(state) or user.has_role?(:admin) | |
end | |
Shipment.state_machines[:state] = StateMachine::Machine.new(Shipment, :initial => 'pending') do | |
event :ready do | |
transition :from => 'pending', :to => 'ready_to_ship' | |
end | |
event :pend do |
OlderNewer