Skip to content

Instantly share code, notes, and snippets.

View vanilla-lazy-load.html
.item {width:300px; display: inline-block; }
.item .itemtitle {font-weight:bold; font-size:2em;}
.hidden {display:none;}
<h1>Amalgam Comics Characters</h1>
leonardofaria / UserMailer.rb
Last active Feb 18, 2016 — forked from willywg/UserMailer.rb
Mass password reset and email notification for Devise 3.5.1 with Rails 4.x
View UserMailer.rb
# Send password reset notification
# path: app/mailers/user_mailer.rb
class UserMailer < ActionMailer::Base
default :from => ""
def password_reset(user, token)
@resource = user
@token = token
mail(:to =>,
:subject => 'Password Reset Notification')
View gist:bae42992c4c0c522bcbb
# paths
View error_messages_helper.rb
module ErrorMessagesHelper
# Render error messages for the given objects. The :message and :header_message options are allowed.
def error_messages_for(*objects)
options = objects.extract_options!
options[:header_message] ||= t(:"errors.template.header", model: t(:"activerecord.models.#{}"), count: objects.compact.first.errors.messages.size)
options[:message] ||= t(:"errors.template.body")
messages = { |o| o.errors.full_messages }.flatten
unless messages.empty?
content_tag(:div, id: "error_explanation") do
list_items = { |msg| content_tag(:li, msg) }
View gist:4388225
leonardofaria / .gitconfig
Created Jul 11, 2011 — forked from ma11hew28/.gitconfig
Bash Script to Install Git on Mac OS X 10.6 (Snow Leopard) Intel x86 (32 bit)
View .gitconfig
name = Matt Di Pasquale
email =
br = branch
ci = commit -am
co = checkout
df = diff
lg = log
ll = log -p