Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# -----------------------------------------------------------------------
# Installs Ruby 2.2 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s raw_script_url_here)
# -----------------------------------------------------------------------
# Set up variables
function readFile(file) {
var reader = new FileReader();
var deferred = $.Deferred();
reader.onload = function(event) {
deferred.resolve(event.target.result);
};
reader.onerror = function() {
deferred.reject(this);
@inre
inre / post_comment.rb
Created July 11, 2012 10:33 — forked from justinko/Plea.markdown
Am I doing it wrong?
# Controllers
class PostController
before_filter :set_entry
def create
@entry.comments.create!(params.merge(author: @current_user))
end
protected
# populate test database before running tests
Rake::Task["db:test:prepare"].enhance do
Customer.establish_connection "test"
Domain.establish_connection "test"
PopulationHelper.populate
end