Skip to content

Instantly share code, notes, and snippets.

module ApplicationHelper
def controller_header_exists?
app_views = File.join(Rails.root, "app", "views")
controller_header = File.join(app_views, "#{controller_name}/_header.html.erb")
File.exists? controller_header
end
def controller_header_partial
"#{controller_name}/header"
end
@robinhoode
robinhoode / xvfb
Created May 27, 2011 20:20
/etc/init.d/xvfb
#!/bin/bash
# TODO: http://wiki.debian.org/LSBInitScripts
if [ -z "$1" ]; then
echo "`basename $0` {start|stop}"
exit
fi
case "$1" in
@robinhoode
robinhoode / selenium
Created May 27, 2011 18:44
/etc/init.d/selenium
#!/bin/bash
# TODO: http://wiki.debian.org/LSBInitScripts
DESC="Selenium server"
RUN_AS=root
JAVA_BIN=/usr/bin/java
SELENIUM_DIR=/etc/selenium
PID_FILE="$SELENIUM_DIR/selenium.pid"