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
/usr/lib64/ruby/site_ruby/1.8/rubygems.rb:233:in `activate': can't activate i18n (~> 0.5.0, runtime) for ["mail-2.2.11", "actionmailer-3.0.1", "rails-3.0.1"], already activated i18n-0.4.2 for ["activemodel-3.0.1", "actionpack-3.0.1", "rails-3.0.1"] (Gem::LoadError) |
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
var javascript_for = function(controller, action, anonymous_function) { | |
var correct_controller = APP.controller_name === controller, | |
correct_action = APP.action_name === action || 'all'; | |
if (correct_controller && correct_action) { | |
anonymous_function(); | |
}; | |
}; | |
javascript_for('events', 'index', function() { |
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
# Regex to find/replace colons for converting css to sass with textmate | |
# For example, converts: | |
# body | |
# color: gray | |
# into: | |
# body | |
# :color gray | |
# find |
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
# Regex to find/replace colons for converting css to sass with textmate | |
# For example, converts: | |
# body | |
# color: gray | |
# into: | |
# body | |
# :color gray | |
# find |
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
def border(string) | |
length = (80 - string.length) / 2 | |
border = '+' * length | |
"#{border} #{string} #{border}" | |
end |
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
def formatted_date_range(start_date, end_date = nil) | |
if start_date && end_date | |
same_month = start_date.month == end_date.month | |
same_year = start_date.year == end_date.year | |
date = "#{start_date.strftime("%B %e")} - #{end_date.strftime("%e, %Y")}" if same_month && same_year | |
date = "#{start_date.strftime("%B %e")} - #{end_date.strftime("%B %e, %Y")}" if !same_month && same_year | |
date = "#{start_date.strftime("%B %e, %Y")} - #{end_date.strftime("%B %e, %Y")}" if !same_year | |
else | |
date = start_date.strftime("%A, %B %e, %Y") |
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
module LayoutHelper | |
def title(page_title, show_title = true) | |
content_for(:title) { page_title.to_s } | |
@show_title = show_title | |
end | |
def show_title? | |
@show_title | |
end | |
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
var todays_date = function() { | |
var month_in_words = function(month_num) { | |
if (month_num === 0) { return "January" }; | |
if (month_num === 1) { return "February" }; | |
if (month_num === 2) { return "March" }; | |
if (month_num === 3) { return "April" }; | |
if (month_num === 4) { return "May" }; | |
if (month_num === 5) { return "June" }; | |
if (month_num === 6) { return "July" }; |
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
var perserve_linebreaks = function(text) { | |
var html = text.replace(/\r\n\r\n/g, "</p><p>"), | |
html = html.replace(/\r\n/g, "<br />"), | |
html = html.replace(/\n\n/g, "</p><p>"), | |
html = html.replace(/\n/g, "<br />"), | |
html = "<p>"+html+"</p>"; | |
return html | |
}; |
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
// tiny plugin to clear form form data. | |
$.fn.clearForm = function() { | |
// iterate each matching form | |
return this.each(function() { | |
// iterate the elements within the form | |
$(':input', this).each(function() { | |
var type = this.type, tag = this.tagName.toLowerCase(); | |
if (type == 'text' || type == 'password' || tag == 'textarea') |