Skip to content

Instantly share code, notes, and snippets.

View traviskroberts's full-sized avatar

Travis Roberts traviskroberts

View GitHub Profile
- if @complete
= "$('#div_name_#{@record.id}').html('complete');"
= "$('#notes_#{@record.id}').replaceWith('<p>#{@record.notes}</p>');"
- else
alert("An error occurred processing your request.");
if RAILS_ENV == "development"
Paperclip.options[:image_magick_path] = '/usr/local/bin/'
end
has_attached_file :image,
:styles => {:thumb => '120x120>', :large => '640x480>' },
:default_style => :thumb,
:url => "/system/:class/:attachment/:id/:style/:basename.:extension",
:path => ":rails_root/public/system/:class/:attachment/:id/:style/:basename.:extension"
alias add_all="svn st | grep '^\?' | awk '{print \$2}' | xargs svn add"
alias rm_all="svn st | grep '^\!' | awk '{print \$2}' | xargs svn rm"
alias add_all="svn st | grep '^\?' | awk '{print \$2}' | xargs svn add"
alias rm_all="svn st | grep '^\!' | awk '{print \$2}' | xargs svn rm"
def self.compilable?
false
end
def compilable?
self.class.compilable?
end
caches_page :index, :if => Proc.new { |c| !c.request.format.json? }
caches_page :index, :if => Proc.new { |c|
c.request.env["HTTP_USER_AGENT"] && !c.request.env["HTTP_USER_AGENT"][/(Mobile\/.+Safari)/]
}
# Rewrite index to check for static
RewriteCond %{HTTP_USER_AGENT} !.*Mobile.*Safari
RewriteRule ^/$ /cache/index.html [QSA]
# Rewrite to check for Rails cached page
RewriteCond %{HTTP_USER_AGENT} !.*Mobile.*Safari
RewriteRule ^([^.]+)$ /cache/$1.html [QSA]
# Redirect iphone.plexusweb.com to www.plexusweb.com with 301
# if they aren't using an iPhone or iPod Touch
RewriteCond %{http_host} ^iphone.plexusweb.com [nc]
RewriteCond %{HTTP_USER_AGENT} !.*Mobile.*Safari
RewriteRule ^/(.*)$ http://www.plexusweb.com/$1 [r=301,nc]