Skip to content

Instantly share code, notes, and snippets.

View multiplegeorges's full-sized avatar

Georges Gabereau multiplegeorges

View GitHub Profile
# Get EPEL set up
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# Instal Dev Tools
yum -y groupinstall 'Development Tools'
# Install Git
yum -y install git
# Install Node
after "deploy:symlink", "deploy:restart_workers"
##
# Rake helper task.
# http://pastie.org/255489
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
def run_remote_rake(rake_cmd)
rake_args = ENV['RAKE_ARGS'].to_s.split(',')
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}"
@multiplegeorges
multiplegeorges / simpleFormat.js
Created December 20, 2012 17:32 — forked from kares/simpleFormat.js
Handlebars helper to replicate the functionality of Rails' simple_format view helper. Wraps everything in a paragraph and corrects newlines and carriage returns. Ignores all other HTML.
Handlebars.registerHelper 'simple_format', (text) ->
carriage_returns = /\r\n?/g
paragraphs = /\n\n+/g
newline = /([^\n]\n)(?=[^\n])/g
text = text.replace(carriage_returns, "\n") # \r\n and \r -> \n
text = text.replace(paragraphs, "</p>\n\n<p>") # 2+ newline -> paragraph
text = text.replace(newline, "$1<br/>") # 1 newline -> br
text = "<p>" + text + "</p>";
def icon(name, options = {})
# icon("camera-retro")
# <i class="icon-camera-retro"></i>
#
# icon('cogs', :class => 'large nav-item', :size => 1.5)
# <i class='icon-cogs large nav-item', style='font-size:1.5em'></i>
classes = ['icon-'+name]
classes << options[:class].split(' ') if options[:class].present?
classes = classes.flatten.join(' ')
@multiplegeorges
multiplegeorges / coffee.bash
Created May 24, 2012 14:33 — forked from jasdeepsingh/coffee.bash
Coffee Watch for all JS in the project
# -o = Output Directory
# -c = Compile
coffee -w -o public/javascripts -c app/assets/coffeescripts
@multiplegeorges
multiplegeorges / bixiToronto.js
Created May 31, 2011 21:00
Bixi Toronto Station Locations in JS
var bixiToronto = [{name:"Jarvis St",lat:"43.662070",long:"-79.376170",nbBikes:"3",nbEmptyDocks:"9"},
{name:"Granby St / Church St",lat:"43.661563",long:"-79.378832",nbBikes:"1",nbEmptyDocks:"5"},
{name:"Mutual St / Gould St",lat:"43.659040",long:"-79.376532",nbBikes:"17",nbEmptyDocks:"11"},
{name:"St George St / Bloor St W",lat:"43.667333",long:"-79.399429",nbBikes:"3",nbEmptyDocks:"11"},
{name:"Madison Ave / Bloor St W",lat:"43.667158",long:"-79.402761",nbBikes:"6",nbEmptyDocks:"9"},
{name:"King St W / Spadina Ave",lat:"43.645323",long:"-79.395003",nbBikes:"14",nbEmptyDocks:"4"},
{name:"Elizabeth St / Edward St",lat:"43.656152",long:"-79.385225",nbBikes:"13",nbEmptyDocks:"2"},
{name:"Scott St / The Esplanade",lat:"43.646669",long:"-79.375152",nbBikes:"5",nbEmptyDocks:"14"},
{name:"Ferry Ramp / Queens Quay W",lat:"43.640823",long:"-79.376265",nbBikes:"18",nbEmptyDocks:"2"},
{name:"Temperance St / Yonge St",lat:"43.650855",long:"-79.379492",nbBikes:"14",nbEmptyDocks:"1"},