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
#!/bin/bash | |
# Function to load .env file and override any duplicates | |
load_env() { | |
local env_file=$1 | |
if [ -f $env_file ]; then | |
while IFS= read -r line | |
do | |
if grep -q "$(echo $line | cut -d'=' -f1)" .env; then | |
# If key exists in .env, remove it |
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
<RoutingRules> | |
<RoutingRule> | |
<Condition> | |
<KeyPrefixEquals/> | |
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals> | |
</Condition> | |
<Redirect> | |
<Protocol>https</Protocol> | |
<HostName>newDomain.com</HostName> | |
<ReplaceKeyPrefixWith>oldStuff/?page=</ReplaceKeyPrefixWith> |
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": "2012-10-17", | |
"Id": "1", | |
"Statement": [ | |
{ | |
"Sid": "1", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, |
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
var parseString = require('xml2js').parseString; | |
exports.handler = function (event, context, callback) { | |
parseString(event.body, function (err, result) { | |
event.body = result; | |
let respondToGateway = { | |
statusCode: '200', | |
body : JSON.stringify({ | |
event: event, |
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 = function (event, context, callback) { | |
let respondToGateway = { | |
statusCode: '200', | |
body : JSON.stringify({ | |
event: event, | |
context: context | |
}), | |
headers : { | |
'Content-Type': 'application/json' | |
} |
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
#set($propertyRegex = '\\n') | |
#set($allParams = $input.params()) | |
{ | |
"body-xml" : $input.json('$').replaceAll($propertyRegex, ''), | |
"params" : { | |
#foreach($type in $allParams.keySet()) | |
#set($params = $allParams.get($type)) | |
"$type" : { | |
#foreach($paramName in $params.keySet()) | |
"$paramName" : "$util.escapeJavaScript($params.get($paramName))" |
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
function getParameterByName(name, url) { | |
if (!url) { | |
url = window.location.href; | |
} | |
name = name.replace(/[\[\]]/g, "\\$&"); | |
let regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), | |
results = regex.exec(url); | |
if (!results) { | |
return null; | |
} |