Skip to content

Instantly share code, notes, and snippets.

View raul-gracia's full-sized avatar
👨‍💻
Coding....

Raul Gracia raul-gracia

👨‍💻
Coding....
View GitHub Profile
@raul-gracia
raul-gracia / Gemfile
Last active October 13, 2015 23:38
My Solution to the Gambit Researching Challenge
source "https://rubygems.org"
gem "capybara"
gem "selenium-webdriver"

PageObject + SimpleDelegator = Awesome Capybara Helpers

I've always liked using the Page Object pattern to write concise, namespaced, and composeable capybara helpers:

When /^I register as a new user$/ do
  NewUserPage.new(self).tap do |page|
    page.visit!
    page.form.fill

page.form.submit!

@raul-gracia
raul-gracia / moduleA.rb
Created October 15, 2013 22:16
A tiny example of how to use ruby idioms
module ModuleA
def self.included(base)
base.send :extend, ClassMethods
base.send :include, InstanceMethods
end
module ClassMethods
def my_method
puts 'ModuleA#my_method'
@raul-gracia
raul-gracia / GROUPED_BY_COMMAS_KATA.md
Last active July 25, 2016 21:44
Kata: Grouped by commas

Kata: Grouped by commas

Finish the solution so that it takes an input 'n' (integer) and returns a string that is the decimal representation of the number grouped by commas after every 3 digits.

Assume: 0 <= n < 1000000000

1 -> "1"

@raul-gracia
raul-gracia / GRABSCRAB_KATA.md
Last active August 29, 2015 13:57
Kata: Arrh, grabscrab!

Kata: Arrh, grabscrab!

Pirates have notorious difficulty with enunciating. They tend to blur all the letters together and scream at people.

At long last, we need a way to unscramble what these pirates are saying.

Write a function that will accept a jumble of letters as well as a dictionary, and output a list of words that the pirate might have meant.

Keybase proof

I hereby claim:

  • I am raul-gracia on github.
  • I am raulgracia (https://keybase.io/raulgracia) on keybase.
  • I have a public key whose fingerprint is B13B E944 219B 1E94 A9D7 EE5A 94D0 BB7F C7C7 585D

To claim this, I am signing this object:

@raul-gracia
raul-gracia / ssh.md
Created November 21, 2017 12:05
Add ssh to github

Create a new key

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Config File

~/.ssh/config

ServerAliveInterval 60
ForwardAgent yes

Effective Code Reviews Without the Pain

Code reviews in most organizations are a painful experience for everyone involved. The developer often feels like it's a bashing session designed to beat out their will. The development leads are often confused as to what is important to point out and what isn't. And other developers that may be involved often use this as a chance to show how much better they can be by pointing out possible issues in someone else's code.

Code reviews, however, don't have to be painful.

Remembering the Purpose

Code reviews have two purposes. Their first purpose is to make sure that the code that is being produced has sufficient quality to be released. In other words, it's the acid test for whether the code should be proamoted to the next step in the process. Code reviews are very effective at finding errors of all types, including those caused by poor structure, those that don't match business process, and also those simple omissions. That's why they are an effective litmus test

@raul-gracia
raul-gracia / dev-setup.md
Last active March 22, 2019 10:09
Dev setup

Install Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Make sure your installation is correct

brew doctor

Install Rbenv

brew install rbenv

rbenv init