This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'json' | |
| require 'net/http' | |
| result = nil | |
| url = URI('https://letsrevolutionizetesting.com/challenge.json') | |
| while result == nil | |
| response = Net::HTTP.get_response(url) | |
| challenge = JSON.parse(response.body) | |
| if challenge.has_key?("follow") |
This file contains hidden or 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
| # Run this code executing in terminal: | |
| # ruby flatten_challenge.rb | |
| # or run in jdoodle: https://www.jdoodle.com/a/mSu | |
| require 'minitest/autorun' | |
| class Array | |
| def flat_me | |
| each_with_object([]) do |element, flattened| | |
| flattened.push *(element.is_a?(Array) ? element.flat_me : element) |
This file contains hidden or 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
| es: | |
| errors: | |
| messages: | |
| expired: "ha expirado, por favor pide una nueva" | |
| not_found: "no encontrado" | |
| already_confirmed: "ya fue confirmada. Intenta ingresar." | |
| not_locked: "no ha sido bloqueada" | |
| not_saved: | |
| one: "Ha habido 1 error:" | |
| other: "Han habido %{count} errores:" |
This file contains hidden or 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
| def link_icon_to(image, text, url, options = {}) | |
| link_to image_tag(image) + " " + text, url, options | |
| end | |