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
%a{:href => name, :class => (@category == name ? "selected" : nil)} | |
%span= name |
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
So I asked about conditionals in Rake and basically everybody | |
told me the concept is ridiculous, but I could maybe use invoke. | |
I'm thinking maybe I asked the wrong question, so here's some more | |
detail so we can either find me a viable solution or confirm I'm crazy. | |
I have a rake task that combines and minifies all my CSS and JS into | |
one file each. I want to automate that task so that it runs before | |
each deploy. | |
Ideally, I type 'cap deploy' as per normal, it runs the minifier tasks, |
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
# Configure ActionMailer | |
require 'action_mailer' | |
ActionMailer::Base.template_root = options.views | |
ActionMailer::Base.smtp_settings = { | |
:address => "smtp.sendgrid.net", | |
:port => "25", | |
:authentication => :plain, | |
:user_name => "[email protected]", | |
:password => "yourpassword" | |
} |
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 pluralize(number, singular) | |
<<-HTML | |
<span class="#{singular.downcase}"> | |
#{number} | |
<span>#{number == 1 ? singular : singular.pluralize}</span> | |
</span> | |
HTML | |
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
// Configure accordingly | |
window._crashmat = {key:'abc123'}; | |
// Capture errors | |
(function(w, cm, woe) { | |
w.onerror = function(e,f,l,c) { | |
cm.e = cm.e || []; cm.e.push([e,f,l,c]); | |
if (woe) woe(e,f,l,c); | |
}; | |
})(window, window._crashmat, window.onerror); |