Skip to content

Instantly share code, notes, and snippets.

@simonrobson
simonrobson / gist:6137148
Last active July 29, 2019 01:28
Disable asset pipeline in Rails 4
Comment in Gemfile:
# Use SCSS for stylesheets
# gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
# gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
# gem 'coffee-rails', '~> 4.0.0'
@simonrobson
simonrobson / install_chef_wrapper.sh
Last active December 19, 2015 19:38
Workaround for Ominbus-installed chef not working with rvm

As described here, ominbus-installed chef doesn't play well with rvm. This script automates wrapping the chef binary symlinks in /usr/bin so they work again. Tested on OSX.

@simonrobson
simonrobson / rdrc-resources.md
Last active December 18, 2015 05:08
RDRC Sources and Followup
@simonrobson
simonrobson / gist:5393451
Last active December 16, 2015 06:39
Celluloid::Timeout based on Celluloid::Future
module Celluloid
class Timeout
public
def self.timeout(sec, exception_class = TimeoutError, &block)
future = Celluloid::Future.new(&block)
begin
future.value(sec)
rescue ::Celluloid::TimeoutError => e
raise exception_class || e
end
/*
Author: Simon Robson
Email: shrobson at google's email service
Javascript to place a baseline layer or grid over the content of a page.
Dependencies:
------------
jQuery (http://www.jquery.com)
/*
Author: Simon Robson
Email: shrobson at google's email service
Javascript to place a baseline grid over the content of a page.
Dependencies:
------------
jQuery (http://www.jquery.com)
@simonrobson
simonrobson / Rails template with git setup
Created September 21, 2009 02:51
Rails template with git setup
# Basic rails template w/git setup. Slightly adapetd from...
# newgit.rb
# from Joao Vitor
# via http://github.com/jeremymcanally/rails-templates
# rails:rm_tmp_dirs
["./tmp/pids", "./tmp/sessions", "./tmp/sockets", "./tmp/cache"].each do |f|
run("rmdir ./#{f}")
end
<!-- Note: this depends on this patch being applied:
http://github.com/simonrobson/spree/commit/5d94572bf5ba8fe8198a21dc1253845603fb3c9d -->
<p>
<% attribute = field[:name].gsub(" ", "_").downcase %>
<%= f.label attribute, field[:name] %>
<% if f.object && f.object.column_for_attribute(attribute).type == :boolean %>
<%= f.check_box attribute %>
<% else %>