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 | |
set -eou pipefail | |
cat <<'EOF' | |
This script demonstrates how repeating sequence in a range works | |
Formula: | |
(((N + 1) % n) ^ (((N + 1) / n) % 2)) * (N + 1) |
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
# other ACM, S3 resources | |
resource "aws_cloudfront_distribution" "site_distribution" { | |
enabled = true | |
is_ipv6_enabled = true | |
aliases = [var.site_name, "www.${var.site_name}"] | |
price_class = "PriceClass_100" | |
default_root_object = "index.html" | |
# ... | |
} |
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 | |
source ./functions.sh | |
for func in "${function_dirs[@]}" | |
do | |
cd "${BASE_DIR}/${func}" | |
go test | |
done |
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
package main | |
import ( | |
"testing" | |
atl "github.com/yogeshlonkar/aws-lambda-go-test/local" | |
) | |
func TestMain(t *testing.T) { | |
response, err := atl.Run(atl.Input{}) |
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 | |
source ./functions.sh | |
# iterate over each package in array, create function and zip it | |
for func in "${function_dirs[@]}" | |
do | |
lambda_func=${func}-function | |
echo "Generating ${lambda_func} artifact" | |
# since each lambda directory contains exactly same main.go |
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
package main | |
import ( | |
"github.com/aws/aws-lambda-go/lambda" | |
"your-repo/handlers" | |
) | |
func main() { | |
lambda.Start(handlers.RequestHandler) | |
} |
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
package handlers | |
import ( | |
"context" | |
) | |
func RequestHandler(ctx context.Context) (string, error) { | |
return "some-string", nil | |
} |
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
class Abc { | |
func1() { | |
return 'This is function 1' | |
} | |
func2() { | |
return 2; | |
} | |
func3() { | |
return Promise.resolve('three'); | |
} |
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
import subprocess | |
ALL_SIGNALS = {} | |
for sig in range(64): | |
sig += 1 | |
sig_cmd = "kill -l " + str(sig) + " 2>/dev/null" | |
ALL_SIGNALS[sig] = subprocess.Popen(sig_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True).communicate()[0].strip() | |
def getSignals(pid, sigCat): | |
signal_cmd = "grep \"^" + sigCat + ":\" \"/proc/" + str(pid) + "/status\" | cut -c 9-" |
NewerOlder