Skip to content

Instantly share code, notes, and snippets.

View toolmantim's full-sized avatar
:shipit:
🎉

Tim Lucas toolmantim

:shipit:
🎉
View GitHub Profile
@toolmantim
toolmantim / snippet.js
Last active December 15, 2015 06:39 — forked from pschyska/main.js
// 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);
def pluralize(number, singular)
<<-HTML
<span class="#{singular.downcase}">
#{number}
<span>#{number == 1 ? singular : singular.pluralize}</span>
</span>
HTML
end
# 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"
}
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,
%a{:href => name, :class => (@category == name ? "selected" : nil)}
%span= name