- example: using bash (aws cli sdk)
- example: using php (aws php sdk v3.*)
- you need to add example.com as custom auth provider in aws console (cognito/federated)
#!/bin/bash | |
set -m | |
showhelp() { | |
echo "Usage: $0 [-ohvrc] <command>" | |
echo "Pipes stderr from command to a new tmux pane." | |
echo " -h | -v split horizontally or vertically (default vertically)" | |
echo " -r send stdout to pane instead of stderr" | |
echo " -o send both stdout and stderr to new panes" | |
echo " -c close pane automatically after program terminates" |
#!/bin/bash | |
S3_BUCKET_NAME=$1 | |
CF_ID=$2 | |
# Sync all files except for service-worker and index | |
echo "Uploading files to $S3_BUCKET_NAME..." | |
aws s3 sync build s3://$S3_BUCKET_NAME/ \ | |
--acl public-read \ | |
--exclude service-worker.js \ |
function getCognitoCreds() { | |
console.log("starting function getCognitoCreds"); | |
var cognitoUser = cognitoFactory.getCognitoUser(); | |
cognitoUser.getSession(function(err, session) { | |
if (err) { | |
console.log(err, err.stack); | |
console.log("error getting the session"); | |
} else { | |
if (session.isValid() === false) { | |
console.log("session is not valid"); |
[core] | |
excludesfile = ~/.gitignore_global | |
pager = diff-so-fancy | less --tabs=4 -RFX | |
[difftool "sourcetree"] | |
cmd = opendiff \"$LOCAL\" \"$REMOTE\" | |
path = | |
[alias] | |
aa = add --all |
List of regions your project is served from when you deploy using surge. | |
yyz.surge.sh : 159.203.50.177 : CA : Toronto | |
jfk.surge.sh : 159.203.159.100 : US : New York | |
sfo.surge.sh : 138.197.235.123 : US : San Francisco | |
lhr.surge.sh : 46.101.67.123 : GB : London | |
ams.surge.sh : 188.166.132.94 : NL : Amsterdam | |
fra.surge.sh : 138.68.112.220 : DE : Frankfurt | |
sgp.surge.sh : 139.59.195.30 : SG : Singapore |
/** | |
* Given a string, converts it to kebab case (lowercase, hyphen-separated). For example, | |
* "makeFoo" becomes "make-foo", and "a Multi Word string" becomes "a-multi-word-string". | |
* | |
* @param {string} string Your input string. | |
* @returns {string} Kebab-cased string. | |
*/ | |
function kebabCase(string) { | |
var result = string; |
var gulp = require('gulp'); | |
var exec = require('child_process').exec; | |
var cmakeCommand = "mkdir -p build; cd build; cmake ..;"; | |
var cleanCommand = "rm -rf build"; | |
var testCommand = "cd build; ctest -V"; | |
//"cmake --build ." |
The Mosquitto Pub CLI | |
$> mosquitto_pub --cert thing-0.pem --key thing-0.prv --cafile aws-iot-rootCA.crt -h XXXXXXXXYYYYY.iot.us-west-2.amazonaws.com -p 8883 -t 'test/thing' -m "Hello from Mosquitto" | |
The Mosquitto Sub CLI | |
$ mosquitto_sub --cert thing-0.pem --key thing-0.prv --cafile aws-iot-rootCA.crt -h XXXXXXXXYYYYY.iot.us-west-2.amazonaws.com -p 8883 -t 'test/+' |
...by adding an EVENT.json
file to the root of your project.
Hosting an event on surge is very simple. It's three easy steps.
surge ./myproject superevent.io
)superevent.io
and *.superevent.io
DNS records to surges servers.EVENT.json
file with the following properties...