Skip to content

Instantly share code, notes, and snippets.

@kevinold
kevinold / safari-open-pages.py
Created September 29, 2023 16:33 — forked from aleks-mariusz/safari-open-pages.py
This script fetches the current open tabs in all Safari windows. Useful to run remotely on your mac when you are at work and want to read a page you have open (remotely) at home but don't remember the url but can log in to your home system on the command line
#!/usr/bin/python
#
# This script fetches the current open tabs in all Safari windows.
# Useful to run remotely on your mac when you are at work and want
# to read a page you have open (remotely) at home but don't remember
# the url but can log in to your home system on the cmmand line
#
import sys
@kevinold
kevinold / manually-remove-resource-from-amplify-project.md
Created August 12, 2022 13:44 — forked from josefaidt/manually-remove-resource-from-amplify-project.md
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
kevinold / find-ecr-image.sh
Created February 10, 2021 23:00 — forked from outofcoffee/find-ecr-image.sh
Check if Docker image exists with tag in AWS ECR
#!/usr/bin/env bash
# Example:
# ./find-ecr-image.sh foo/bar mytag
if [[ $# -lt 2 ]]; then
echo "Usage: $( basename $0 ) <repository-name> <image-tag>"
exit 1
fi
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )"

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

#!/bin/bash
branchname=${1:-$(git rev-parse --abbrev-ref HEAD)}
if ! [ -x "$(command -v jq)" ]; then
echo 'Error: "jq" is not installed.' >&2
exit 1
fi
if [ ! $SECRET_GH_TOKEN ]; then
@kevinold
kevinold / delay-promise.js
Created June 18, 2019 22:26 — forked from joepie91/delay-promise.js
ES6 Promise.delay
module.exports = function(duration) {
return function(){
return new Promise(function(resolve, reject){
setTimeout(function(){
resolve();
}, duration)
});
};
};
@kevinold
kevinold / README.md
Created June 17, 2019 13:42 — forked from NoriSte/README.md
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)

Parameters:
Env:
Description: An environment name that will be prefixed to resource names
Type: String
AllowedValues: ["development", "production"]
resources:
NetworkRole:
Type: "AWS::IAM::Role"
Properties:
@kevinold
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.
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: https://github.com/serverless/serverless/issues/1439
@kevinold
kevinold / editPage.js
Created June 4, 2019 16:30 — forked from pmarquees/editPage.js
Edit page (bookmarlet)
javascript:document.body.contentEditable = 'true'; document.designMode='on'; void 0