October 2008
3 posts
1 tag
Ruby Process Lock and Graceful Failovers
If you are running several thin or mongrel instances it can be useful to designate one as master and the others as slaves — say for a backup task that only really needs to run once per machine.
A nice way of doing it is with a process lock.
When a server starts it tries to grab a file lock and write its process ID. The first server to do so becomes the master process. You can tell if the owner...
1 tag
Link Like DHTML Elements And Disabling Text...
When turning a non-anchor element into an onclickable using JavaScript, you may have noticed that browsers will still allow users to select text ranges.
Disable the behaviour using this:
element.onselectstart = function(){return false};
element.unselectable = "on";
element.style.MozUserSelect = "none";
1 tag
Mac OS X: Tar Without Resource Forks & File...
You can stop Tar from archiving the ._ files that Mac OS uses to mark up its file system with an undocumented environment variable:
export COPYFILE_DISABLE=true
Thanks Norman Walsh