Skip to content

Instantly share code, notes, and snippets.

View ScreamingHawk's full-sized avatar
🦄
Making magic

Michael Standen ScreamingHawk

🦄
Making magic
View GitHub Profile
@ScreamingHawk
ScreamingHawk / json-to-swagger-definition.py
Created April 4, 2017 19:46
Convert a JSON file to a Swagger Definition
import sys
import json
def eexit(message):
"""Print a message and exit."""
print(message)
exit(1)
def convert(inFile, outFile):
"""Convert the JSON file to swagger YAML."""

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@ScreamingHawk
ScreamingHawk / humanifyArray.js
Last active June 1, 2017 22:54
Convert Javascript array into human readable list
function humanifyArray(arr, lastWord){
if (!arr || arr.length === 0){
// Return an empty string for blank arrays
return ''
} else if (arr.length == 1){
// Return the sole array item if only 1 item
return arr[0]
}
// Duplicate array to prevent modification issues
arr = arr.slice(0)
@ScreamingHawk
ScreamingHawk / create_admin.template
Created September 26, 2017 23:52
AWS CloudFormation Template for creating an Admin user with a Password and Access Key
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"AdminName": {
"NoEcho": "false",
"Type": "String",
"Description": "New admin account name",
"MinLength": "1",
"MaxLength": "41",
"AllowedPattern": "[a-zA-Z0-9]*",

Keybase proof

I hereby claim:

  • I am screaminghawk on github.
  • I am screaminghawk (https://keybase.io/screaminghawk) on keybase.
  • I have a public key ASBocdkH6yDRUr8O7tuZvA3kj3rxhX6MXPk7tEZnLM2cxQo

To claim this, I am signing this object:

@ScreamingHawk
ScreamingHawk / OZ Payment Splitter Setup.md
Last active June 3, 2024 19:57
How to set up and use OZ Payment Splitter
@ScreamingHawk
ScreamingHawk / forge_compile_with_source.ts
Created June 11, 2024 20:24
Forge compile with source content
import { exec as execNonPromise } from 'child_process'
import { copyFile, mkdir, readFile, rm, writeFile } from 'fs/promises'
import { join } from 'path'
import util from 'util'
import {
BUILD_DIR,
DEPLOYABLE_CONTRACT_NAMES,
} from './constants'
const exec = util.promisify(execNonPromise)