Skip to content

Instantly share code, notes, and snippets.

View naderio's full-sized avatar

Nader Toukabri naderio

View GitHub Profile
Parameter Serie 1 Serie 2 Serie 3
1 10 17 5
2 12 13 5
3 14 15 10
@naderio
naderio / README.md
Last active December 12, 2015 00:59
CORS with node.js and jQuery.

Test

node hello-service.js to run service on port 8081, test with curl http://localhost:8081/ and curl -X POST -d name=John in terminal

serve -p 8080 . to run app on port 8080 (temporary static content server), test http://localhost:8080/ in browser

@naderio
naderio / script.sh
Last active October 13, 2015 22:18
Bash script file-based lock
#!/bin/bash
LOCK='path/to/file.lock'
[ -f "$LOCK" ] && { echo 'locked' >&2; exit 1; } || { touch "$LOCK" && trap 'rm -f "$LOCK"; exit $?' INT TERM EXIT; } || { echo 'unable to lock' >&2; exit 2; }
# processing