- http://www.wearebeef.co.uk | http://www.beefsource.co.uk
This file contains hidden or 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
# Be sure to restart your server when you modify this file. | |
my_formats = { | |
:short_ordinal => '%d %B - %H:%M', | |
:short_dot => ' %d.%m.%y', | |
:long_dot => '%H:%M - %d.%m.%y', | |
:time => '%H:%M' | |
} | |
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(my_formats) |
This file contains hidden or 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/bash | |
# using all types of newlines, search for a rails log header for a certain action of a certain controller | |
# copy and paste into terminal | |
pcregrep -MN ANY 'Processing FatController#action_man([^\n]*\n){10}' log/production.log |
This file contains hidden or 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 | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
This file contains hidden or 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
# Place in /config/initializers | |
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
if html_tag =~ /<(input|textarea|select|label)[^>]+style=/ | |
style_attribute = html_tag =~ /class=['"]/ | |
html_tag.insert(style_attribute + 7, "fieldWithErrors ") | |
elsif html_tag =~ /<(input|textarea|select|label)/ | |
first_whitespace = html_tag =~ /\s/ | |
html_tag[first_whitespace] = ' class="fieldWithErrors" ' | |
end | |
html_tag |
This file contains hidden or 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
<Location /> | |
# Insert filter | |
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript | |
# Netscape 4.x has some problems... | |
BrowserMatch ^Mozilla/4 gzip-only-text/html | |
# Netscape 4.06-4.08 have some more problems | |
BrowserMatch ^Mozilla/4\.0[678] no-gzip |
This file contains hidden or 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
# Add this to your gem file | |
group :production do | |
gem 'dalli' | |
gem 'rack-cache', :require => 'rack/cache' | |
gem 'rack-contrib', :require => 'rack/contrib' | |
end |
OlderNewer