Skip to content

Instantly share code, notes, and snippets.

View oinak's full-sized avatar

Fernando Martínez oinak

View GitHub Profile
@oinak
oinak / three.rb
Last active August 29, 2015 14:01
Tercer ejercicio del taller de metaprogramación
module Donor
def foo(extra)
puts "bar #{extra}"
end
def not_foo
puts "not bar"
end
end
@oinak
oinak / keybase.md
Created January 7, 2015 07:24
keybase.md

Keybase proof

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:

@oinak
oinak / README.md
Created January 23, 2015 18:50
Guilded Rose Kata al WeArePeople

The Gilded Rose Code Kata

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.

@oinak
oinak / first.rb
Created June 10, 2015 09:34
Primer ejercicio del taller de metaprogramación
module Includeable
def have_module
"metodo desde Includeable"
end
def self.included(mod)
puts "Includeable incluido en #{mod}"
end
end
class First
@oinak
oinak / tic_tac_toe.rb
Last active August 29, 2015 14:23
As a meditation on https://practicingruby.com/articles/meditations-on-bad-and-good-code-1 artice, here is my first attempt at refactoring
module TicTacToe
class Game
def self.play
new.run
end
def players
@players ||= %w(X O).cycle
end
@oinak
oinak / hash_proc_abuse.rb
Created September 15, 2015 16:48
Meditation on ruby hashes with procs as "dinamic conditions" for keys
>> 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"
@oinak
oinak / openspace_iniciarse.md
Last active December 15, 2015 19:49
Rails openspace 2015 - Iniciación en Rails

Rails openspace 2015 - Iniciación en Rails

¿Cómo habéis empezado, qué obstaculos habéis encontrado?

  • Un ejemplo ERE en empresa grande le llevo a replantearse la carrera profesional. Encontró la información muy desplabazada, dificil de localizar.
  • Los bootcamps en el extranjero/en inglés parecen mas completos/exhaustivos
  • Algunos de los principiantes que han trabajado sólos y luego junto a seniors dicen que hay mucha diferencia en la velocidad de arendizaje.

Accionables

  • Tratar de replicar el "vídeo iniciático del blog en 15 minutos" con versiones/ejemplos actuales.
  • Dos empresas que tienen experiencia en la edición de cursos de ruby con metodologías distintas (presenciales/remotas) ¿podrían combinarse?
@oinak
oinak / README.md
Last active March 21, 2024 11:59
A meditation on Sandi Metz's "Make Everything the Same" blog post

Sandi Metz's blog post:

Make Everything The Same

Upon reading I decided to try an implement Sandi's concept before lookig at her code.

It wasn't worth a dime in comparison, but after reading her code, I decided to try and improvise from there.

Of course, this is no more than remixing the composition from a genius to feel your own style on it. But it was a interesting exercise. I opted for a module with no state and pure functions.

@oinak
oinak / Gemfile
Created June 15, 2016 15:34
Dummy backend for credit card form UI/UX exercise
source 'https://rubygems.org'
ruby '2.3.0'
gem 'sinatra'
@oinak
oinak / bottles.rb
Created July 21, 2016 19:38
First go at 99 bottles of OOP exercise, following instructions, (code just for the green), running time: 21'
class Bottles
def song
verses(99, 0)
end
def verse(n)
<<-END
#{bottles(n).capitalize} on the wall, #{bottles(n)}.
#{what_now(n)}, #{bottles(n-1)} on the wall.