Skip to content

Instantly share code, notes, and snippets.

View anniethiessen's full-sized avatar
🌻

Annie Thiessen anniethiessen

🌻
  • Okanagan, BC
  • 23:50 (UTC -08:00)
View GitHub Profile
@anniethiessen
anniethiessen / upload_aws_step_functions_state_machine.sh
Last active April 28, 2024 19:13
Script file to upload AWS Step Functions state machine.
#!/usr/bin/env bash
: '
Script file to upload AWS step functions state machine.
Ensure AWS is installed and configured,
define script variables, then execute script.
Accepts -v (verbose output) and -q (quiet output) arguments.
@anniethiessen
anniethiessen / publish_ec2_startup_package.sh
Last active August 4, 2024 03:03
Script file to build and publish AWS EC2 instance start-up package.
#!/usr/bin/env bash
: '
Script file to build and publish AWS EC2 instance start-up package.
Ensure AWS is installed and configured,
define script variables, then execute script.
Accepts -v (verbose output) and -q (quiet output) arguments.
Prerequisites:
@anniethiessen
anniethiessen / deploy_aws_elasticbeanstalk_application.sh
Last active October 27, 2024 17:58
Script file to prepare and deploy AWS ElasticBeanstalk applications.
#!/usr/bin/env bash
: '
Script file to prepare and deploy AWS ElasticBeanstalk applications.
Ensure AWS EB CLI is installed and configured,
define script variables, then execute script.
First argument must be ElasticBeanstalk environment name,
secondly optional option -c <configuration>, and
@anniethiessen
anniethiessen / shell_script_essentials.sh
Last active October 26, 2023 00:31
Script file to run prior to other script files for more unified and pretty shell scripts.
#!/usr/bin/env bash
: '
Script file to run prior to other script files for more unified and pretty shell scripts.
Accepts -v (verbose output) and -q (quiet output) arguments.
Features:
- variable "QUIET_OUTPUT": set by -q option
(e.g. % command &> $\{QUIET_OUTPUT}\)
@anniethiessen
anniethiessen / deploy_aws_cloudformation_stack.sh
Last active October 26, 2023 00:39
Script file to package and deploy AWS CloudFormation stacks.
#!/usr/bin/env bash
: '
Script file to package and deploy AWS CloudFormation stacks.
Ensure AWS CLI is installed and configured, ensure STOML is installed,
define script variables and configuration file, then execute script.
Accepts -v (verbose output) and -q (quiet output) arguments.
@anniethiessen
anniethiessen / deploy_aws_sam_application.sh
Last active October 26, 2023 00:37
Script file to build, package, and deploy AWS SAM application.
#!/usr/bin/env bash
: '
Script file to build, package, and deploy AWS SAM applications.
Ensure AWS CLI and SAM CLI are installed and configured,
define script variables and configuration file, then execute script.
Accepts -v (verbose output) and -q (quiet output) arguments.
@anniethiessen
anniethiessen / publish_aws_lambda_layer.sh
Last active April 2, 2024 22:30
Script file to build and publish AWS lambda layer.
#!/usr/bin/env bash
: '
Script file to build and publish AWS lambda layer.
Ensure AWS is installed and configured, docker engine is started,
define script variables, then execute script.
Accepts -v (verbose output) and -q (quiet output) arguments.
var shopifyUrl = `https://${env.shopifyShopUrl}/admin/api/${env.shopifyApiVersion}`;
var shopifyCreds = btoa(`${env.shopifyApiKey}:${env.shopifyApiSecretKey}`);
var shopifyHeaders = {
"Content-Type" : "application/json",
"Authorization" : `Basic ${shopifyCreds}`
};
let shopifyResponse = await fetch(`${shopifyUrl}/orders/${orderId}.json`, {headers: shopifyHeaders});
// let response = await shopifyResponse.json();
let response = await shopifyResponse.text();
@anniethiessen
anniethiessen / atob_btoa.js
Last active June 11, 2021 20:26
Manual b64 encoder/decoder
// encode
var s = ''
var c, d, e, f, g, h, i, j, o, b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", k = 0, l = 0, m = "", n = [];
do c = s.charCodeAt(k++), d = s.charCodeAt(k++), e = s.charCodeAt(k++), j = c << 16 | d << 8 | e, f = 63 & j >> 18, g = 63 & j >> 12, h = 63 & j >> 6, i = 63 & j, n[l++] = b.charAt(f) + b.charAt(g) + b.charAt(h) + b.charAt(i); while (k < s.length);
m = n.join(""), o = s.length % 3;
s = (o ? m.slice(0, o - 3) :m) + "===".slice(o || 3);
// decode
var s = ''
var b, c, d, e = {}, f = 0, g = 0, h = "", i = String.fromCharCode, j = s.length;
@anniethiessen
anniethiessen / AirtableShopifyWebhookAutomation.js
Last active June 11, 2021 19:02
Airtable automation to create record on Shopify Webhook
// trigger: When webhook received
// action: run script
let env = input.config();
// TODO: verify webhook
// python ex
// hmac.compare_digest(
// base64.b64encode(
// hmac.new(