This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rest-client' if RAILS_ENV == "development" | |
require 'scalarium-api-wrapper' if RAILS_ENV == "development" | |
namespace :my_application do | |
namespace :scalarium do | |
desc "deploy to development" | |
task :deploy_to_dev, :comment, :needs => :environment do |t, args| | |
if RAILS_ENV == "development" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example: | |
# | |
# hash = { 'project.name' => "name of the project", | |
# 'project.date.start' => "start date of the project", | |
# 'project.date.end' => "end date of the project" } | |
# | |
# Spreedsheet2yaml.create_yaml(hash) | |
# | |
module Spreedsheet2yaml | |
@result = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
require 'yaml' | |
yaml_file_en = YAML::load( File.open( 'config/locales/en.yml' ) ) | |
yaml_file_de = YAML::load( File.open( 'config/locales/de.yml' ) ) | |
def flat_hash(hash, k = []) | |
return {k => hash} unless hash.is_a?(Hash) | |
hash.inject({}){ |h, v| h.merge! flat_hash(v[-1], k + [v[0]]) } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CashCounterService | |
CURRENCIES_BILLS = { | |
usd: [1, 2, 5, 10, 20, 50, 100], | |
eur: [1, 2, 5, 10, 20, 50, 100, 200] | |
} | |
def calculate_money_received(to_pay, currency=:eur) | |
to_pay = to_pay.ceil | |
CURRENCIES_BILLS[currency].each do |bill| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CashCounterService | |
CURRENCIES_BILLS = { | |
usd: [1, 2, 5, 10, 20, 50, 100], | |
eur: [1, 2, 5, 10, 20, 50, 100, 200] | |
} | |
def calculate_money_received(to_pay, currency=:eur) | |
to_pay = to_pay.ceil | |
CURRENCIES_BILLS[currency].each do |bill| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% brew doctor !10032 | |
Error: undefined method `head' for #<SoftwareSpec:0x100a97210> | |
Please report this bug: | |
https://github.com/mxcl/homebrew/wiki/troubleshooting | |
/usr/local/Library/Formula/sphinx.rb:24 | |
/usr/local/Library/Homebrew/formula.rb:722:in `instance_eval' | |
/usr/local/Library/Homebrew/formula.rb:722:in `resource' | |
/usr/local/Library/Formula/sphinx.rb:23 | |
/usr/local/Library/Homebrew/formulary.rb:40:in `require' | |
/usr/local/Library/Homebrew/formulary.rb:40:in `klass' |