Skip to content

Instantly share code, notes, and snippets.

@bds
bds / .dockerignore
Last active May 28, 2019 05:11
Docker Node Starter
.env
.gitignore
*.swp
node_modules
npm-debug.log
// http://www.2ality.com/2013/09/javascript-unicode.html
function toUTF16(codePoint) {
var TEN_BITS = parseInt('1111111111', 2);
function u(codeUnit) {
return '\\u'+codeUnit.toString(16).toUpperCase();
}
if (codePoint <= 0xFFFF) {
return u(codePoint);
}
@bds
bds / jwtRS256.sh
Created May 27, 2019 04:00 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@bds
bds / docker-image-delete-feedback.sh
Created May 28, 2019 16:15
Delete Docker images with feedback
# https://github.com/docker/for-mac/issues/2501#issuecomment-436997480
docker images -f "dangling=true" -q | xargs -I {} echo docker rmi -f {}
@bds
bds / docker-shell.sh
Created June 17, 2019 17:06 — forked from falvarez/docker-shell.sh
Run docker container, mount current working directory and get interactive shell
docker run -ti -v $(pwd):/tmp DOCKER_IMAGE /bin/bash
@bds
bds / .dockerignore
Last active March 25, 2020 04:03
Crystal Docker Starter
.env
.gitignore
*.swp
node_modules
npm-debug.log