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
/** | |
* A LocalStorage-based mutex. Guarantees¹ that only one browser window will be | |
* able to execute the code inside the callback at a time. | |
* | |
* Based on the Alur and Taubenfeld fast lock | |
* (http://www.cs.rochester.edu/research/synchronization/pseudocode/fastlock.html) | |
* with an added timeout to ensure there will be eventual progress in the event | |
* that a window is closed in the middle of the callback. | |
* | |
* 1. The guarantee assumes that the algorithm is correctly implemented. |
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
#! /bin/sh | |
# Init. script for phantomjs, based on Ubuntu 12.04 skeleton. | |
# Author: Anthony Lapenna <lapenna.anthony@gmail.com> | |
PATH=/sbin:/usr/sbin:/bin:/usr/bin | |
DESC="Phantomjs service" | |
NAME=phantomjs | |
DAEMON=/usr/bin/$NAME | |
PIDFILE=/var/run/$NAME.pid | |
SCRIPTNAME=/etc/init.d/$NAME |