See the aws-cdk-js-dev-guide README for more details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2.1 | |
orbs: | |
my_orb: &my_orb_version my_namespace/[email protected] | |
workflows: | |
my_workflow: | |
jobs: | |
- my_orb/audit: | |
# passes the fully qualified namespace/orb@version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Python: Debug Tests", | |
"type": "python", | |
"request": "launch", | |
"program": "${file}", | |
"purpose": ["debug-test"], | |
"console": "integratedTerminal", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# inspired by https://stackoverflow.com/a/29535256/2860309 | |
pids="" | |
failures=0 | |
function my_process() { | |
seconds_to_sleep=$1 | |
exit_code=$2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = async (event) => { | |
return new Promise(async (resolve) => { | |
const uriEncodedBody = event.body; | |
const uriEncodedBodyWithSpacesFixed = uriEncodedBody.replace(/\+/g, ' '); | |
const unencodedBody = decodeURIComponent(uriEncodedBodyWithSpacesFixed); | |
const arrayOfFormItems = unencodedBody.split('&'); | |
console.log(arrayOfFormItems); | |
resolve({ | |
"isBase64Encoded": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# A script that receives start and end parameters in the format HH:mm and | |
# exit with an error code if the current time is not within the desired | |
# window. | |
# The given times are not inclusive, so if you want 06:00-10:00 inclusive | |
# you need to specify 05:59 and 10:01 respectively. | |
# This script assumes that we are interested in time periods shorter than | |
# a single day, and it handles overnight periods. | |
# Inspired by https://unix.stackexchange.com/a/395936/305967 |
See the Medium article for more details.
In a nutshell: AWS has recently rolled out a change wherein S3 buckets cannot be created with public access.
These Serverless snippets are for use in the article, with the final.form.yaml
being the one that worked for us, but mileage may vary and some people (and parts of our own solution) needed different options.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setup_mocker(mocker, expected_requests): | |
"""Note: this requires the exact number of expected requests. | |
expected_requests is an array in the following format: | |
[ | |
{ | |
"url": "https://www.example.com", | |
"method": "GET", | |
"exc": requests.exceptions.ConnectTimeout, # will override "status_code" and "json" | |
"status_code": 404, # defaults to 200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// calculate md5 hash for entire src directory | |
// according to https://unix.stackexchange.com/a/35834/305967 | |
console.log(`calculating md5 hash for ${layer}...`); | |
let hash = process.execSync(`tar -cf - ${layerSrcPath} | md5sum | cut -d ' ' -f 1`, { encoding: 'utf8' }).trim(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict" | |
// build-layers copies layers/src folder contents into layer/build, then runs | |
// the npm install and prune commands | |
const fs = require("fs"); | |
const fse = require("fs-extra"); | |
const path = require("path"); | |
const spawn = require("child_process"); | |
const { checksumDirectory } = require("simple-recursive-checksum"); |
OlderNewer