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
| \ | |
| \ | |
| \\ | |
| \\ | |
| >\/7 | |
| _.-(6' \ | |
| (=___._/` \ | |
| ) \ | | |
| / / | | |
| / > / |
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
| ## (Install Homebrew if needed) | |
| ## /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| ## Add GO paths to .bash_profile / .zsh etc | |
| export GOPATH="${HOME}/.go" | |
| export GOROOT="$(brew --prefix golang)/libexec" | |
| export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin" | |
| ## Install Go (Homebrew installed) | |
| brew install 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
| echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf | |
| echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf | |
| sudo sysctl -w kern.maxfiles=65536 | |
| sudo sysctl -w kern.maxfilesperproc=65536 | |
| ulimit -n 65536 65536 | |
| echo "ulimit -n 65536 65536" >> .bashrc | |
| source .bashrc |
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
| // https://github.com/dimorphic/bitch.pizza/blob/master/src/js/get-giphy.js | |
| // Get your key @ https://developers.giphy.com/ | |
| const GIPHY_API_KEY = '<KEY-HERE>'; // random key. Get your own! | |
| // Giphy API defaults | |
| const API = { | |
| baseURL: 'https://api.giphy.com/v1/', | |
| resource: 'gifs', | |
| key: GIPHY_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
| let parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
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
Show hidden characters
| { | |
| "compilerOptions": { | |
| "allowSyntheticDefaultImports": true, | |
| "declaration": false, | |
| "emitDecoratorMetadata": true, | |
| "experimentalDecorators": true, | |
| "lib": [ | |
| "dom", | |
| "es2015", | |
| "es2016" |
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 eco { | |
| echo "=====================================" | |
| echo $1 | |
| echo "=====================================" | |
| } | |
| # Settings | |
| export USER_DIR=/home/ec2-user | |
| export NODE_VERSION=v8.4.0 # Node.js version to install |
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
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>AWS IoT Pub/Sub Demo</title> | |
| </head> | |
| <body> | |
| <h1>AWS IoT Pub/Sub Demo</h1> | |
| <form> | |
| <button type="button" id="connect">connect!</button> |
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 {Subscriber} from "rxjs"; | |
| export function Once(milliseconds: number = 0) { | |
| return function (target, key, descriptor) { | |
| var originalMethod = descriptor.value; | |
| descriptor.value = function (...args) { | |
| var sub = originalMethod.apply(this, args); | |
| setTimeout(() => { | |
| if (sub instanceof Subscriber) { | |
| sub.unsubscribe(); |
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
| // ref: http://blog.wolksoftware.com/decorators-reflection-javascript-typescript | |
| // ref: https://medium.com/@NetanelBasal/javascript-make-your-code-cleaner-with-decorators-d34fc72af947#.fe9f2rfb8 | |
| export function timeout( milliseconds: number = 0 ) { | |
| return function( target, key, descriptor ) { | |
| var originalMethod = descriptor.value; | |
| descriptor.value = function (...args) { |