To reset all changes after the last commit in git, you can use the following commands:
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 | |
######################################################################################################################### | |
# branch.sh is used, with arguments, to create a new branch from main that uses a slugified ADO ticket number and title # | |
######################################################################################################################### | |
# Exit immediately if a command exits with a non-zero status | |
set -o errexit | |
# Treat unset variables as an error when substituting | |
set -o nounset | |
# Fails entire pipeline if any command fails |
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
# A simple way of aliasing short project names to deeper working directories. | |
# - If you work on multiple machines and keep the same directory layout then this becomes very useful | |
# | |
# 1. Create a secret gist called joy.json that looks something like the following. Use your own meaningful project names and create as many entries as you need | |
# | |
# { | |
# "bookmarks": { | |
# "project1": "/full/path/to/the/project1/directory", | |
# "project2": "/full/path/to/the/project2/directory, | |
# } |
A collection of ZSH aliases for executing various SDK CLIs
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
{ | |
"pages": { | |
"/products/product-1.xml": { | |
"title": "Product One", | |
"summary": "A short summary of this product", | |
"detail": "Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum", | |
"price": "$9.99", | |
"modelName": "product-summary" | |
}, | |
"/products/product-2.xml": { |
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
(cors) { | |
@origin{args.0} header Origin {args.0} | |
header @origin{args.0} Access-Control-Allow-Origin "{args.0}" | |
} | |
sub.domain.com { | |
reverse_proxy 127.0.0.1:3000 | |
header Access-Control-Allow-Methods * | |
header Access-Control-Allow-Headers content-type | |
header Access-Control-Allow-Credentials true |
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
/** | |
* @description: Handler entry point. | |
* - Note AWS CloudFront Functions use a modified ECMAScript 5.1 compatible runtime and NOT NodeJS. | |
* - Use var, not const or let | |
* - Use string concatenation and not template literals | |
* - Beware that the CloudFront Functions Console editor and test environment do NOT mimic CloudFront 100% | |
* @date 2022-01-26 | |
* @param {object} event: A CloudFront Function event (expecting a Viewer Request event) | |
* @return {object}: A CloudFront response or request object (depends whether conditions allow pass through or 301 redirect) | |
*/ |
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
{ | |
"info": { | |
"_postman_id": "e5d286ab-6f35-46dd-a9f0-9c3c55b5db18", | |
"name": "MailChimp", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "Get lists info", | |
"request": { |
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
# Debug state | |
DEBUG=true | |
# MySQL configuration | |
DB_USER= | |
DB_PASSWORD= | |
DB_NAME= | |
DB_HOST=db:3306 | |
# WordPress configuration |
Implements a simple basic auth function to attach to an AWS CloudFront distribution. Note that basic auth is inherently insecure and should not be used to protect content of value. It does work well to keep search engines and crawlers out of stage websites.
- Create a new Lambda function in us-east-1 (AWS does not support @Edge functions from other regions at this time.)
- Copy the contents of index.js to the new Lambda
- Replace {your-shared-username} and {your-shared-password} with actual values
- Attach to CloudFront as a viewer request function
NewerOlder