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( d ) { | |
// Create a copy of this date object | |
var target = new Date(d.valueOf()); | |
// ISO week date weeks start on monday | |
// so correct the day number | |
var dayNr = (d.getDay() + 6) % 7; | |
// Set the target to the thursday of this week so the |
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
version: "3" | |
services: | |
zookeeper: | |
image: 'bitnami/zookeeper:latest' | |
container_name: zookeeper | |
ports: | |
- '2181:2181' | |
environment: | |
- ALLOW_ANONYMOUS_LOGIN=yes | |
kafka: |
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 factorialCallback(acc, n, callback) { | |
if (n === 0) { | |
callback(acc); | |
} else { | |
setImmediate(() => factorialCallback(acc * n, n - 1, callback)); | |
} | |
} | |
function timedFactorialCallback(n) { | |
const start = new Date(); |
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
/* ******************************************************************************************* | |
* THE UPDATED VERSION IS AVAILABLE AT | |
* https://github.com/LeCoupa/awesome-cheatsheets | |
* ******************************************************************************************* */ | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html |
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
docker build -t friendlyname . # Create image using this directory's Dockerfile | |
docker run -p 4000:80 friendlyname # Run "friendlyname" mapping port 4000 to 80 | |
docker run -d -p 4000:80 friendlyname # Same thing, but in detached mode | |
docker exec -it [container-id] bash # Enter a running container | |
docker ps # See a list of all running containers | |
docker stop <hash> # Gracefully stop the specified container | |
docker ps -a # See a list of all containers, even the ones not running | |
docker kill <hash> # Force shutdown of the specified container | |
docker rm <hash> # Remove the specified container from this machine | |
docker rm $(docker ps -a -q) # Remove all containers from this machine |