Skip to content

Instantly share code, notes, and snippets.

<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 February 18, 2016 20:58 — forked from willywg/UserMailer.rb
Mass password reset and email notification for Devise 3.5.1 with Rails 4.x
# 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')
@leonardofaria
leonardofaria / gist:bae42992c4c0c522bcbb
Created January 26, 2016 04:15
livestreamer mp3 grabber
#!/bin/bash
# paths
LIVESTREAMER="livestreamer"
FFMPEG="ffmpeg"
#####
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) }
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 July 11, 2011 00:29 — forked from ma11hew28/.gitconfig
Bash Script to Install Git on Mac OS X 10.6 (Snow Leopard) Intel x86 (32 bit)
[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