Skip to content

Instantly share code, notes, and snippets.

View vanilla-lazy-load.html
<html>
<head>
<style>
.item {width:300px; display: inline-block; }
.item .itemtitle {font-weight:bold; font-size:2em;}
.hidden {display:none;}
</style>
</head>
<body>
<h1>Amalgam Comics Characters</h1>
@leonardofaria
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 => "no-reply@example.com"
def password_reset(user, token)
@resource = user
@token = token
mail(:to => user.email,
:subject => 'Password Reset Notification')
View gist:bae42992c4c0c522bcbb
#!/bin/bash
# paths
LIVESTREAMER="livestreamer"
FFMPEG="ffmpeg"
#####
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.#{objects.compact.first.class.name.downcase}"), count: objects.compact.first.errors.messages.size)
options[:message] ||= t(:"errors.template.body")
messages = objects.compact.map { |o| o.errors.full_messages }.flatten
unless messages.empty?
content_tag(:div, id: "error_explanation") do
list_items = messages.map { |msg| content_tag(:li, msg) }
View gist:4388225
http://www.flotcharts.org/
http://www.highcharts.com/
http://www.jscharts.com/
http://oesmith.github.com/morris.js/
http://raphaeljs.com/
http://g.raphaeljs.com/
http://www.rgraph.net/examples/
http://code.shutterstock.com/rickshaw/
http://xaviershay.github.com/tufte-graph/
@leonardofaria
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
[user]
name = Matt Di Pasquale
email = my@fake-email.com
[alias]
br = branch
ci = commit -am
co = checkout
df = diff
lg = log
ll = log -p