Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
kevindice /
Created Jan 27, 2019
A shell script for uploading a React app build to S3 + CloudFront for deployment
# 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 \
View sample-cognito.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");
View gist:91a829ea21550a7a7d9469220a7c2f73
excludesfile = ~/.gitignore_global
pager = diff-so-fancy | less --tabs=4 -RFX
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
aa = add --all
sintaxi / regions.txt
Last active May 15, 2019
Surge Regions
View regions.txt
List of regions your project is served from when you deploy using surge. : : CA : Toronto : : US : New York : : US : San Francisco : : GB : London : : NL : Amsterdam : : DE : Frankfurt : : SG : Singapore
tdukart / kebabCase.js
Last active Feb 2, 2020
JavaScript Kebab Case function
View kebabCase.js
* 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;
bastman /
Last active Jun 21, 2020
aws cognito examples (bash / php): custom auth provider

Aws Cognito: Custom Auth (Developer Authenticated Identities)

How to get OpenID Token & IdentityId from AWS Cognito?

  • example: using bash (aws cli sdk)
  • example: using php (aws php sdk v3.*)


  • you need to add as custom auth provider in aws console (cognito/federated)
lashex / aws-iot-mosquitto
Created May 23, 2016
Example Mosquitto CLI pub/sub using AWS IoT MQTT endpoint
View aws-iot-mosquitto
The Mosquitto Pub CLI
$> mosquitto_pub --cert thing-0.pem --key thing-0.prv --cafile aws-iot-rootCA.crt -h -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 -p 8883 -t 'test/+'
sintaxi /
Last active Dec 8, 2017
Instructions for hosting an event on

Hosting a competition on adding an EVENT.json file to the root of your project.

Hosting an event on surge is very simple. It's three easy steps.

  1. Publish a project to Surge to your root domain (eg. surge ./myproject
  2. Point and * DNS records to surges servers.
  3. Add EVENT.json file with the following properties...
kamilZ / xdebug-install-php7
Created Dec 5, 2015
Install xdebug from sources php7.0
View xdebug-install-php7
sudo apt-get install php7.0-dev
tar -xzf xdebug-2.4.0rc2.tgz
cd xdebug-2.4.0RC2/
./configure --enable-xdebug
sudo cp modules/ /usr/lib/.
sudo echo 'zend_extension="/usr/lib/"' > /etc/php/7.0/fpm/conf.d/20-xdebug.ini
joar /
Last active Aug 7, 2020
Add a field to an object with JQ
# Add field
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}'
# {
# "hello": "world",
# "foo": "bar"
# }
# Override field value
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}'
You can’t perform that action at this time.