Skip to content

Instantly share code, notes, and snippets.


Tim Lucas toolmantim

View GitHub Profile
View snippet.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);
View new_plural.rb
def pluralize(number, singular)
<span class="#{singular.downcase}">
<span>#{number == 1 ? singular : singular.pluralize}</span>
View action_mailer_for_sinatra.rb
# Configure ActionMailer
require 'action_mailer'
ActionMailer::Base.template_root = options.views
ActionMailer::Base.smtp_settings = {
:address => "",
:port => "25",
:authentication => :plain,
:user_name => "",
:password => "yourpassword"
View minify.rake
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,
View gist:74185
%a{:href => name, :class => (@category == name ? "selected" : nil)}
%span= name