Skip to content

Instantly share code, notes, and snippets.

View bcaccinolo's full-sized avatar

Benoit Caccinolo bcaccinolo

View GitHub Profile
@bcaccinolo
bcaccinolo / bowling.exs
Last active July 6, 2017 15:29
My Elixir bowling kata implementation (presentation of the problem: http://codingdojo.org/kata/Bowling/)
defmodule Bowling do
def score rolls do
calculate 1, rolls
end
def calculate i, list do
if i > 10 do
0
@bcaccinolo
bcaccinolo / i18n_lookup.rb
Created December 22, 2014 08:08
Rails i18n_lookup
# config/initializers/i18n_lookup.rb
class I18n::Backend::Simple
module Implementation
protected
def lookup(locale, key, scope = [], options = {})
init_translations unless initialized?
keys = I18n.normalize_keys(locale, key, scope, options[:separator])