Skip to content

Instantly share code, notes, and snippets.

@tmepple
tmepple / goon.rb
Created June 9, 2017 15:09
Simple Homebrew Formula to compile and install Goon driver.
class Goon < Formula
desc "Goon Driver for Elixir Porcelain Library"
homepage "https://github.com/alco/goon"
url "https://github.com/alco/goon.git", :tag => "v1.1.1", :revision => "756deaad8465c4326841d8b8cbd194f724be6160"
head "https://github.com/alco/goon.git"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
@justinweiss
justinweiss / filterable.rb
Last active August 12, 2024 10:10
Filterable
# Call scopes directly from your URL params:
#
# @products = Product.filter(params.slice(:status, :location, :starts_with))
module Filterable
extend ActiveSupport::Concern
module ClassMethods
# Call the class methods with names based on the keys in <tt>filtering_params</tt>
# with their associated values. For example, "{ status: 'delayed' }" would call
@tomash
tomash / migrate_model_translations_from_globalize1.rb
Created May 31, 2009 11:56
Script to migrate from Globalize1 to Globalize2 model translations
require 'config/environment.rb'
class GlobalizeCountry < ActiveRecord::Base
end
class GlobalizeLanguage < ActiveRecord::Base
end
class GlobalizeTranslation < ActiveRecord::Base
belongs_to :language, :class_name => "GlobalizeLanguage"