Skip to content

Instantly share code, notes, and snippets.

View ascheucher's full-sized avatar

Andreas Scheucher ascheucher

  • SaaSQuadrat e.U.
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def adjust_inv_level_to_zero(inv_level, variant, retry=10):
try:
inv_level = rct.call_shopify_api_with_retry_and_throttle(
inv_level.adjust,
inv_level.location_id,
variant.inventory_item_id,
inv_level.available * -1)
if inv_level.errors and inv_level.errors.size > 0:
logger.info('could not save {}: {}'.format(
inv_level, inv_level.errors.errors))
@ascheucher
ascheucher / shopify_graph_ql_shema_2020_10.json
Created December 11, 2020 21:53
The 2020-10 Shopify GraphQl schema.
This file has been truncated, but you can view the full file.
{
"data": {
"__schema": {
"directives": [
{
"args": [
{
"defaultValue": null,
"name": "if",
"type": {
@ascheucher
ascheucher / sed cheatsheet
Created December 3, 2017 21:28 — forked from un33k/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
#!/bin/bash
# Authorize TCP, SSH & ICMP for default Security Group
#ec2-authorize default -P icmp -t -1:-1 -s 0.0.0.0/0
#ec2-authorize default -P tcp -p 22 -s 0.0.0.0/0
# The Static IP Address for this instance:
IP_ADDRESS=$(cat ~/.ec2/ip_address)
# Create new t1.micro instance using ami-cef405a7 (64 bit Ubuntu Server 10.10 Maverick Meerkat)