Skip to content

Instantly share code, notes, and snippets.

View dinoshauer's full-sized avatar
💭
🦖🦕🦖🦕🦖🦕🦖🦕🦆

Kasper Jacobsen dinoshauer

💭
🦖🦕🦖🦕🦖🦕🦖🦕🦆
View GitHub Profile

Keybase proof

I hereby claim:

  • I am dinoshauer on github.
  • I am dinoshauer (https://keybase.io/dinoshauer) on keybase.
  • I have a public key ASACkcYccbcvyHPiEka8gIiY3i1OhYPdR0wZPb2WsiA3Qgo

To claim this, I am signing this object:

@dinoshauer
dinoshauer / npm.sh
Last active November 15, 2016 06:35
Pull the Node.gitignore file from github on yarn or npm init
#!/bin/bash
function npm() {
case $* in
init* ) shift 1; command npm init "$@" && wget https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore -O .gitignore ;;
* ) command npm "$@" ;;
esac
}
#!/bin/bash
# process arguments
while [[ $# -gt 0 ]]
do
case "$1" in
*:* )
HOST=$1
shift 1
;;
--)
@dinoshauer
dinoshauer / README.md
Last active April 29, 2016 10:37
wait-for-it.js

wait-for-it.js

Installation

wget https://gist.githubusercontent.com/Dinoshauer/01dd9298dec6ce388a810dcfb4aaf471/raw/e95aa0f4e682b63558c40c5837967dbe4b5bdce1/wait-for-it.js && \
chmod +x wait-for-it.js

Usage:

To reproduce the weird state:

  • start a quorum of zookeepers
  • start 2 processes running test-kazoo.py
  • kill one of the zookeepers that one of the processes connected to
  • start a third test-kazoo.py process, you will see that the watcher is not being fired in one of them and the rest of the processes seems to have entered a dead-lock
[program:node-api]
user=root
command=/home/root/node/api.js 8000
stdout_logfile=/home/root/logs/%(program_name)s.log
redirect_stderr=true
autorestart=true
[program:node-crunch]
user=root
command=/home/root/node/crunch.js