This file contains 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
openssl genrsa -out tls.key 4096 | |
openssl req -new -x509 -key tls.key -out tls.cert -days 360 -subj |
This file contains 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
// from: http://book.mixu.net/node/ch10.html | |
'use strict'; | |
const http = require('http'); | |
const url = require('url'); | |
const server = http.createServer((sreq, sres) => { | |
const { pathname } = url.parse(sreq.url); | |
const opts = { |
This file contains 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
// from: http://book.mixu.net/node/ch9.html | |
'use strict'; | |
const fs = require('fs'); | |
const file = fs.createWriteStream('./output.txt'); | |
process.stdin.pipe(file); | |
// stdin is paused by default |
This file contains 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
// idea from: https://www.youtube.com/watch?v=APUCMSPiNh4 | |
class IllegalStateError extends Error { | |
constructor(...args) { | |
super(...args); | |
} | |
} | |
class Empty { | |
size() { |
This file contains 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
#333333,#1E2320,#709080,#FFFFFF,#1E2320,#FFFFFF,#F0DFAF,#CC9393 | |
// https://slackthemes.net/#/dark_zenburn |
This file contains 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
const flatten = xs => Array.isArray(xs) | |
? [].concat(...xs.map(flatten)) | |
: xs; |
This file contains 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
{ | |
// from: https://gist.github.com/bhongy/3817b9b8fad85096039df78e339deae4 | |
/* | |
Suggested VSCode Extensions | |
- mgmcdermott.vscode-language-babel | |
- dbaeumer.vscode-eslint | |
- flowtype.flow-for-vscode | |
- esbenp.prettier-vscode |
This file contains 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
.wrapper { | |
height: 100vh; | |
width: 100vw; | |
background-color: green; | |
} |
This file contains 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
function partial(func /*, 0..n args */) { | |
var args = Array.prototype.slice.call(arguments, 1); // save all additional arguments to args (except index 0: func) | |
return function() { | |
var allArguments = args.concat(Array.prototype.slice.call(arguments)); // then add arguments from the original function declaration | |
return func.apply(this, allArguments); | |
}; | |
} | |
// See: http://stackoverflow.com/questions/373157/how-can-i-pass-a-reference-to-a-function-with-parameters |
This file contains 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
source ~/.profile | |
# === SSH Agent from Atlassian - https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git | |
SSH_ENV=$HOME/.ssh/environment | |
# start the ssh-agent | |
function start_agent { | |
echo "Initializing new SSH agent..." | |
# spawn ssh-agent |
NewerOlder