Skip to content

Instantly share code, notes, and snippets.

View gist:1218660
require 'rubygems'
require 'middleman'
run Middleman.server
use Rack::Static,
:urls => ["/stylesheets", "/images"],
:root => "build"
run lambda { |env|
View gist:1218661
2011-09-15T06:10:35+00:00 heroku[slugc]: Slug compilation finished
2011-09-15T06:10:37+00:00 heroku[web.1]: Starting process with command `thin -p 41476 -e production -R /home/heroku_rack/ start`
2011-09-15T06:10:39+00:00 app[web.1]: /app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.2.6/lib/sinatra/showexceptions.rb:23:in `rescue in call': undefined method `[]' for #<Rack::Static:0x00000002784cc0> (NoMethodError)
2011-09-15T06:10:39+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.2.6/lib/sinatra/showexceptions.rb:21:in `call'
2011-09-15T06:10:39+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.2.6/lib/sinatra/base.rb:1272:in `block in call'
2011-09-15T06:10:39+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.2.6/lib/sinatra/base.rb:1303:in `synchronize'
2011-09-15T06:10:39+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.2.6/lib/sinatra/base.rb:1272:in `call'
2011-09-15T06:10:39+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1
olivierlacan / sublime_text_2_coffeescript
Created Sep 27, 2011
Add CoffeeScript support to Sublime Text 2 easily
View sublime_text_2_coffeescript
mkdir -p ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/CoffeeScript
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/CoffeeScript
git clone git:// CoffeeScript.tmbundle
olivierlacan / prod_env.rb
Created Oct 13, 2011
Production env config
View prod_env.rb
Appname::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
olivierlacan / .pryrc
Created Jan 5, 2012 — forked from renz45/.pryrc
Pry configuraton
View .pryrc
# switch default editor for pry to sublime text
Pry.config.editor = "sublime"
# format prompt to be <Rails version>@<ruby version>(<object>)>
Pry.config.prompt = proc do |obj, level, _|
prompt = "\e[1;30m"
prompt << "#{Rails.version} @ " if defined?(Rails)
prompt << "#{RUBY_VERSION}"
"#{prompt} (#{obj})>\e[0m"
View trythis.rb
ask "Please enter wicked envy labs conference ID number.", {
:choices => "[5 DIGITS]",
:onChoice => lambda { |event|
if event.choice.interpretation == "12345"
say "Welcome to the ascending conference call."
conference "12345"
say "We hope you had fun, call back soon!"
say "This is conference ID is not active."
olivierlacan / An_example.markdown
Created Feb 18, 2012 — forked from renz45/An_example.markdown
Re-style Sublime Text 2 sidebar to a darker theme
View An_example.markdown

This re-styles your sublime text 2 sidebar to be darker, so it doesn't blind you when using a dark theme.

Dark sublime text 2 sidebar

Save the Default.sublime-theme file into packages/Theme - Default, make a backup of your original if you want to be able to go back easily.

olivierlacan / 1_before.html.haml
Created Jun 27, 2012
The Beauty of Decorators
View 1_before.html.haml
// Ew, conditional soup
- subscription = current_user.subscription
%p Next bill date:
- if subscription.next_bill_on
%h4= subscription.next_bill_on.to_formatted_s(:long)
- else
%h4 Unknown
- if subscription.suspending? || subscription.suspended?
olivierlacan /
Created Jul 7, 2012
Track changes to a skeleton Rails app since a given version
#!/usr/bin/env zsh
# -------------------------------------------------------------------------------- #
# 1304046900 Track changes to a skeleton Rails app since a given `base_version`
# -------------------------------------------------------------------------------- #
## Changelog
# - Update 7/7/2012:
# * rewrote to use Bundler instead of RubyGems
# * attempting to switch to a master branch for which no commit existing was causing a pathspec error
# * simplified rails new commands by running them on the current path (after changing directory to tmp/skeleton_check of course).
# * renamed `old_version` variable to `base_version` for clarity
olivierlacan / rails314_to_316.diff
Created Jul 7, 2012
Rails 3.1.4 to 3.1.6 defaults
View rails314_to_316.diff
diff --git a/Gemfile b/Gemfile
index ee62ec2..0ace91f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,9 +1,9 @@
-source ''
+source ''
-gem 'rails', '3.1.4'
+gem 'rails', '3.2.6'