I hereby claim:
- I am oinak on github.
- I am oinak (https://keybase.io/oinak) on keybase.
- I have a public key whose fingerprint is 02CA 3672 C423 0B10 014D 05F2 6668 B7D8 8FA5 D8AC
To claim this, I am signing this object:
#!/bin/env ruby | |
class Time | |
Days = Day = 24 * 60 * 60 | |
FixHolidays = Hash.new([]).merge(1 => [1,6], 5 => [1], 10 => [12], 12 => [25]) | |
def self.holidays | |
@@holidays ||= Hash.new(Hash.new([])) # Year Specific holidays { 2013 => { 1 => [7,8]} } | |
end |
module Atribulator | |
module ClassMethods | |
def my_attr_reader(name) | |
define_method("#{name}") do | |
instance_variable_get("@#{name}") | |
end | |
end | |
def my_attr_writer(name, my_type = nil) | |
if my_type.nil? |
module Donor | |
def foo(extra) | |
puts "bar #{extra}" | |
end | |
def not_foo | |
puts "not bar" | |
end | |
end |
I hereby claim:
To claim this, I am signing this object:
This is a Ruby version of the Gilded Rose Kata, found [here](http://www.iamnotmyself.com/2011/02/13/RefactorThisTheGildedRoseKata.aspx I Am Not Myself).
This is a refactorying kata, so you will be starting with a legacy code base. To work the Kata, clone this git repository and checkout the tag 'start-here'. Read the description below for the "rules" involving this kata.
module Includeable | |
def have_module | |
"metodo desde Includeable" | |
end | |
def self.included(mod) | |
puts "Includeable incluido en #{mod}" | |
end | |
end | |
class First |
module TicTacToe | |
class Game | |
def self.play | |
new.run | |
end | |
def players | |
@players ||= %w(X O).cycle | |
end |
# Dieta para verano: | |
- desayuno: galletas de fibra + café/infusión (en mi caso limonada casera) | |
- media mañana: fruta (1 ó 2 melocotones o 3 rodajas piña al natural o 2 rodajas de sandía) | |
- comida: verdura hervida, a la plancha, en conserva o ensalada a tutiplén. Filete de vaca, de pollo o pescado blanco a la plancha. Sin límite de cantidad, cébate! | |
- media tarde: fruta, como a media mañana | |
- cena: como la comida + un yogur desnatado o infusión. | |
- Recomendaciones ;) | |
- si no la tienes, compra una sartén antiadherente de verdad y límpiala justo después de usarla: podrás hacer cosas a la plancha sin usar aceite y podrás usar más de este para aliñar ensaladas y verduras | |
- si echas de menos las salsas, prueba a combinar especias, cebolla, ajo, limón... sirven para animar cualquier plato, por insulso que sea |
>> h = {true => '1 is odd', false => '1 is even'} | |
=> {true=>"1 is odd", false=>"1 is even"} | |
>> h[true] | |
=> "1 is odd" | |
>> h = {1.odd? => '1 is odd', 1.even? => '1 is even'} | |
=> {true=>"1 is odd", false=>"1 is even"} | |
>> h[true] | |
=> "1 is odd" |
#!/usr/bin/env ruby | |
# jazzfonica.rb for Mac OS X | |
# Scans the visible networks for JAZZTEL_XXXX or WLAN_XXXX and calculates the password | |
# Ported from PHP example at http://kz.ath.cx/wlan/codigo.txt | |
# Download and execute with ruby (e.g. ruby jazzfonica.rb) from a Terminal | |
require 'digest/md5' | |
messages = [] | |
unless !File.exists?('/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport') |