๐
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 swift | |
// swiftc displaymode1.swift | |
import Foundation | |
import CoreGraphics | |
// Thanks to: | |
// https://gist.github.com/bellbind/27220148ea752335259dfce63f43bd5d | |
// https://stackoverflow.com/a/36299062/3671330 | |
// | |
// Usage: |
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
label: SNS catch-all | |
title: | | |
{{ | |
default | |
( | |
printf | |
"SNS message - %s" | |
(last (splitList ":" .TopicArn)) | |
) | |
.Subject |
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
aws sns publish \ | |
--region us-east-1 \ | |
--topic-arn "arn:aws:sns:us-east-1:123456789012:n17-example-aws-sns-test-hook-templated" \ | |
--message "Hello!" | |
# Optionally you can also use | |
[--subject "Notification title"] | |
[--message-attributes '{"myKey1":{"DataType":"String","StringValue":"Mr. Anderson"}}'] |
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 | |
max="$1" | |
date | |
echo "url: $2 | |
rate: $max calls / second" | |
START=$(date +%s); | |
get () { | |
response=$(curl --fail-with-body -v "$1" 2>&1) | |
if [[ $? -ne 0 ]]; then |
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
n17() { sh -c "$(wget -qO - "https://n17.io/sh")" -- -k "N17_RAW_API_KEY" "$@"; } |
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
mycommand; n17 -t "Script execution finished!" |
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 -e | |
# Define the n17 function | |
n17() { sh -c "$(wget -qO - "https://n17.io/sh")" -- -k "N17_RAW_API_KEY" "$@"; } | |
# This function will be invoked on script error. | |
n17TrapErr() { | |
n17 \ | |
-t "Script execution error!" \ | |
-c "$(cat < |
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
And we'll get: | |
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
mycommand; n17 -t "Script execution finished!" |
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
n17() { sh -c "$(wget -qO - "https://n17.io/sh")" -- -k "N17_RAW_API_KEY" "$@"; } |