Skip to content

Instantly share code, notes, and snippets.

View mathieugagne's full-sized avatar

Mathieu Gagné mathieugagne

View GitHub Profile
@mathieugagne
mathieugagne / colors.rb
Created February 21, 2014 19:28 — forked from nhocki/colors.rb
module Colors
def colorize(text, color_code)
"\033[#{color_code}m#{text}\033[0m"
end
{
:black => 30,
:red => 31,
:green => 32,
:yellow => 33,
# http://stackoverflow.com/questions/14972253/simpleform-default-input-class
# https://github.com/plataformatec/simple_form/issues/316
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
@mathieugagne
mathieugagne / Gemfile
Last active December 29, 2015 17:58 — forked from pcreux/Gemfile
Rails + Unicorn + Heroku
group :production do
gem 'unicorn'
# Enable gzip compression on heroku, but don't compress images.
gem 'heroku-deflater'
# Heroku injects it if it's not in there already
gem 'rails_12factor'
end
#!/usr/bin/ruby1.9.1 -Kw
# -*- coding: utf-8 -*-
class Edge
attr_accessor :src, :dst, :length
def initialize(src, dst, length = 1)
@src = src
@dst = dst
@length = length