Skip to content

Instantly share code, notes, and snippets.

View ch1ago's full-sized avatar
🏠
Working mostly from home since 2006

Thiago Almeida ch1ago

🏠
Working mostly from home since 2006
  • Mexico City
  • 10:10 (UTC -06:00)
View GitHub Profile
@ch1ago
ch1ago / a.md
Last active September 15, 2015 13:50

#Sign Out Capability

escopo, 4 features

http://cl.ly/image/3u403M3X1c29

specs, 6 cenarios

http://cl.ly/image/0q2a133Y0v30

@ch1ago
ch1ago / list.rb
Last active August 29, 2015 14:27
Refactoring Sample
module Hello
class Account
class List
def initialize(request)
@request = request
end
def list
gather_wanted_strings
@ch1ago
ch1ago / meta_dilma.rb
Created August 10, 2015 16:13
Rode isso no seu IRB :)
atual = 0
meta = Float::INFINITY
presidente = "Dilma"
while presidente == "Dilma"
while atual < meta
atual += 1
puts "momento atual: #{atual}, meta: #{meta}"
sleep(1)
@ch1ago
ch1ago / brute_force_modem.rb
Created April 11, 2015 18:43
That time you are sure your modem's password is a 6 digits number
require 'net/http'
require 'colorize'
ip = '10.1.1.1'
uri = URI("http://#{ip}/")
('00'..'31').each do |d|
('00'..'12').each do |m|
('00'..'99').each do |y|
@ch1ago
ch1ago / gist:4dab953eaa48083f654a
Created March 13, 2015 22:59
PLEASE HELP, CALL TO ACTION
PLEASE HELP, CALL TO ACTION
Facebook has accidentaly removed our sister group.
Take 60 seconds of your time,
make a report and help us bring it back!
Submit this form: https://www.facebook.com/help/contact/157461604368161
Group name: Ruby on Rails
URL: https://www.facebook.com/groups/rubyandrails/
Text:
module Geocoder
module Lookup
class Base
private
def read_fixture(file)
File.read(File.join("spec", "fixtures", "geocoder", file)).strip.gsub(/\n\s*/, "")
end
end
class Google < Base
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
@ch1ago
ch1ago / app.rb
Last active August 29, 2015 14:07
require "net/http"
require "uri"
require 'date'
require "json"
require "colorize"
class Eleicoes
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
url = window.location.toString() + ".json"
$.ajax(
url,
{
method: "PATCH",
data: {contact: {name: "James"}}
}
)