Skip to content

Instantly share code, notes, and snippets.

View sebthemonster's full-sized avatar

sebthemonster

  • Bordeaux, France
View GitHub Profile
@sebthemonster
sebthemonster / An-Anonymous-Pen.markdown
Last active December 26, 2015 07:49 — forked from anonymous/An-Anonymous-Pen.markdown
Great Transformations on menu icon ;)
@sebthemonster
sebthemonster / bootstrap_form_builder.rb
Created October 19, 2012 08:51 — forked from ivliaspiration/bootstrap_form_builder.rb
Twitter Bootstrap FormBuilder
# FormBuilder for Ruby on Rails which produces HTML code compatible with Twitter Bootstrap
# horizontal forms styles (see here: http://twitter.github.com/bootstrap/base-css.html#forms)
#
# Features:
# * displays validation errors in-line
# * has custom option - label-text - to override default label text for an input
#
# Requirements:
# By default, Rails will wrap a field with validation error in an ugly div tag that breaks
# the layout. To override this behaviour, add
class Object
def to_boolean
compare_value = self.class == String ? self.downcase : self
case compare_value
when "no","false",false, "0", 0
false
when "yes","true",true, "1", 1
true
else
!!compare_value
@sebthemonster
sebthemonster / pre-commit.rspec.rb
Created October 25, 2011 18:47 — forked from david-hodgetts/pre-commit
pre-commit git hook, runs rspec if branch is master
#!/usr/bin/env ruby
# pre-commit git hook
# will run rspec if and only if current branch is master
# script adapted from http://book.git-scm.com/5_git_hooks.html
# source : https://gist.github.com/1141992
NO_COMMIT_MESSAGE = "\aDID NOT COMMIT YOUR FILES!"
FORMAT = :html