I hereby claim:
- I am seanlf on github.
- I am seanlf (https://keybase.io/seanlf) on keybase.
- I have a public key ASCEHzpVt3QmZUcbzwcJyPiUHROJpAAKH6W-on8NUB6Bfwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
on open location magnetLink | |
tell application "iTerm" | |
tell current window | |
set theCommand to "bash -cil \"[[ -f ~/.bashrc ]] && . ~/.bashrc; webtorrent-hybrid download " & magnetLink & " && read\"" | |
create tab with default profile command theCommand | |
end tell | |
end tell | |
end open location |
class ShopifyAPIClient | |
attr_accessor :shop_id | |
def initialize | |
@params = Hash.new | |
@params[:basic_auth] = {username: ENV['SECRET_API_KEY'], password: ''} | |
@api_url = "https://www.shopify.this.is.a.sample.com/" | |
end | |
def orders |
// Global variables | |
var PRODUCTS = {}; | |
var CATEGORIES_SEARCHED_FOR = ['Wallet', 'Lamp']; | |
var TOTAL_PRICE = 0, TOTAL_WEIGHT = 0; | |
function get_price_for_all_variants_for_searched_categories(products){ | |
// Filter all the products on the search | |
PRODUCTS = PRODUCTS.filter(function(product){ | |
// Indicates if the product's category is found in the search list | |
return CATEGORIES_SEARCHED_FOR.indexOf(product.product_type) !== -1; |
// Global variables | |
var CATEGORIES_SEARCHED_FOR = ['Keyboard', 'Computer'], MAXIMUM_WEIGHT/*in grams*/ = 100*1000; | |
function get_maximum_number_of_items_for_categories_searched_for_under_maximum_weight(variants, maximum_weight){ | |
var current_weight = 0, subtotal = 0, items = {}; | |
for(index = 0, variants_length = variants.length; index < variants_length; index++){ | |
if(current_weight + variants[index].grams < maximum_weight){ | |
items[variants[index].id] = 1; | |
current_weight += variants[index].grams; | |
} else{break;} |