View lambda-concurrency-to-cloudwatch.py
#!/usr/bin/env python | |
import boto3 | |
import datetime | |
import time | |
ENABLED_REGIONS = [ | |
"us-east-1", | |
"us-west-2", | |
"eu-west-1", | |
"eu-central-1", |
View chunk_encode.py
import json | |
import itertools | |
import StringIO | |
iterencode = json.JSONEncoder().iterencode | |
class SerializableList(list): | |
""" |
View README.md
We can test webhook callbacks with a little http server and a localtunnel.
Run server.js
to spin up a local http server on port 8080
. It just exposes a top-level route and will print the received header and payload of any request. Then create a localtunnel to have a non-local url that proxies all requests to localhost:8080
.
First, install dependencies with npm install
.
Then start the express server with npm start
.
View mocha-guide-to-testing.js
// # Mocha Guide to Testing | |
// Objective is to explain describe(), it(), and before()/etc hooks | |
// 1. `describe()` is merely for grouping, which you can nest as deep | |
// 2. `it()` is a test case | |
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run | |
// before/after first/each it() or describe(). | |
// | |
// Which means, `before()` is run before first it()/describe() |
View test.js
import test from 'tape'; | |
const before = test; | |
const after = test; | |
// beforeEach/afterEach rely on shared state. | |
// That's a big anti-pattern for testing. | |
// It's also silly to run something before and after | |
// ever test -- many of your tests won't need it. |
View make_hmac.py
#!/usr/bin/python | |
''' | |
A little script for generating HMACs. | |
> ./make_hmac.py SECRET BODY | |
HMAC | |
For example ... | |
> ./make_hmac.py secret foo |
View README.md
collapsible markdown?
CLICK ME
yes, even hidden code blocks!
print("hello world!")
View install.py
# https://help.shopify.com/api/guides/authentication/oauth#scopes | |
scopes = [] | |
scopes.append('read_content') | |
scopes.append('write_content') | |
scopes.append('read_themes') | |
scopes.append('write_themes') | |
scopes.append('read_products') | |
scopes.append('write_products') | |
scopes.append('read_customers') |
View index.js
'use strict'; | |
const Hapi = require('hapi'); | |
const server = new Hapi.Server(); | |
server.connection({ | |
host: 'localhost', | |
port: 8000 | |
}); |
NewerOlder