Skip to content

Instantly share code, notes, and snippets.

View stackdumper's full-sized avatar

Elijah A. stackdumper

View GitHub Profile
# create order
--------------------
Request: curl -X 'POST' -d '{"order":{"id":0,"number":0,"order_number":0,"updated_at":"","user_id":"","customer":{"id":0,"email":"[email protected]","accepts_marketing":false,"created_at":"","updated_at":"","first_name":"Elijah","last_name":"Atamas","orders_count":0,"state":"","total_spent":"","last_order_id":0,"note":null,"verified_email":false,"multipass_identifier":null,"tax_exempt":false,"tags":"","last_order_name":"","currency":"","accepts_marketing_updated_at":"","marketing_opt_in_level":null,"tax_exemptions":null,"admin_graphql_api_id":""},"line_items":[{"variant_id":39869281009856,"quantity":1}],"shipping_address":{"address1":"Hlinky St, 2","city":"Dnipro","country":"Ukraine","first_name":"Elijah","last_name":"Atamas","phone":"555-625-1199","zip":"49000","country_code":"UA"},"shipping_lines":[{"code":"shopify-Standard-0.73","price":"0.73","title":"Standard"}],"transactions":[{"id":0,"parent_id":0,"kind":"authorization","status":"success","currency":"","amount":"7
if (window.location.pathname == "/cart") {
fetch("/cart.js")
.then((res) => res.json())
.then((t) => JSON.stringify(t.items.map((t) => [t.product_title, t.id, t.quantity])))
.then(JSON.stringify)
.then(btoa)
.then((qcCartId) => {
console.log("QC CART ID", qcCartId);
var checkoutButton = document.querySelector("input[name=checkout]");
[
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
},
{
"userId": 1,
"id": 2,
[
{
"postId": 1,
"id": 1,
"name": "id labore ex et quam laborum",
"email": "[email protected]",
"body": "laudantium enim quasi est quidem magnam voluptate ipsam eos\ntempora quo necessitatibus\ndolor quam autem quasi\nreiciendis et nam sapiente accusantium"
},
{
"postId": 1,
@stackdumper
stackdumper / app.yaml
Created July 18, 2019 15:34
vault-to-env - Kubernetes
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: vte-example
labels:
app: vte-example
spec:
replicas: 1
selector:
matchLabels:
type Replace<Target extends Record<string, any>, Value extends any> = {
[Key in keyof Target]: Target[Key] extends object
? Replace<Target[Key], Value>
: Value
}
@stackdumper
stackdumper / settings.json
Last active March 5, 2019 09:16
My VSCode settings
{
"workbench.colorTheme": "One Dark Pro Bold",
"editor.fontFamily": "'Fira Code'",
"editor.fontLigatures": true,
"window.zoomLevel": 0.9,
"workbench.iconTheme": "file-icons",
"workbench.statusBar.visible": false,
"editor.minimap.enabled": false,
"editor.scrollBeyondLastLine": false,
"files.insertFinalNewline": true,
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"lib": ["esnext"],
"jsx": "preserve",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
import ava from 'ava'
import nanoid from 'nanoid'
import mongoose from 'mongoose'
/*
test wrapper for ava
creates new database and drops it afterwards
*/
export const test = (message, cb) =>
ava(message, async (t) => {
export default {
compileEnhancements: false,
extensions: ['ts'],
require: ['ts-node/register', 'tsconfig-paths/register'],
sources: ['src/**/*'],
}