Skip to content

Instantly share code, notes, and snippets.


Kevin Old kevinold

View GitHub Profile
kevinold /
Created August 12, 2022 13:44 — forked from josefaidt/
Instructions for surgically removing non-existent resource from local Amplify project

Let's say we've removed a Lambda Layer from the Lambda Console and are no longer able to perform operations using the Amplify CLI.

An error occurred fetching the latest layer version metadata for ""

> amplify remove function
? Choose the resource you would want to remove 10263layer58c94806 (layer)
When you delete a layer version, you can no longer configure functions to use it.
However, any function that already uses the layer version continues to have access to it.
✖ Loading layer data from the cloud...
kevinold /
Created February 10, 2021 23:00 — forked from outofcoffee/
Check if Docker image exists with tag in AWS ECR
#!/usr/bin/env bash
# Example:
# ./ foo/bar mytag
if [[ $# -lt 2 ]]; then
echo "Usage: $( basename $0 ) <repository-name> <image-tag>"
exit 1
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )"
branchname=${1:-$(git rev-parse --abbrev-ref HEAD)}
if ! [ -x "$(command -v jq)" ]; then
echo 'Error: "jq" is not installed.' >&2
exit 1
if [ ! $SECRET_GH_TOKEN ]; then
kevinold / delay-promise.js
Created June 18, 2019 22:26 — forked from joepie91/delay-promise.js
ES6 Promise.delay
View delay-promise.js
module.exports = function(duration) {
return function(){
return new Promise(function(resolve, reject){
}, duration)
kevinold /
Created June 17, 2019 13:42 — forked from NoriSte/
Conio Business site monitoring

A Cypress test checking the most common issues faced by Conio with the AWS/S3 management (with a custom configuration for Brotli)

View roles-stack.yaml
Description: An environment name that will be prefixed to resource names
Type: String
AllowedValues: ["development", "production"]
Type: "AWS::IAM::Role"
kevinold / serverless-deploy-user.yaml
Created June 5, 2019 17:20 — forked from bsamuel-ui/serverless-deploy-user.yaml
Cloudformation template to deploy permissions for deploying a serverless project.
View serverless-deploy-user.yaml
AWSTemplateFormatVersion: 2010-09-09
Description: >
Constructs a managed IAM policy to deploy a serverless project.
This template assumes the stack is being deployed in the current region and account.
You can then attach this policy to other IAM objects, such as users or roles.
Based on the work done in:
kevinold / editPage.js
Created June 4, 2019 16:30 — forked from pmarquees/editPage.js
Edit page (bookmarlet)
View editPage.js
javascript:document.body.contentEditable = 'true'; document.designMode='on'; void 0
kevinold / postgres_queries_and_commands.sql
Created May 15, 2019 20:30 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'