⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
p1 = File.open('people1.txt').readlines | |
p2 = File.open('people2.txt').readlines | |
puts p1 - p2 | |
=begin | |
ruby-1.9.2-p136 :006 > f1 = File.open('people1.txt').readlines | |
=> ["tatiana\n", "ana lucia\n", "sergio ney \n", "marco aurelio \n"] | |
ruby-1.9.2-p136 :007 > f2 = File.open('people2.txt').readlines | |
=> ["tatiana\n", "cantido \n", "marco aurelio\n", "renata"] |
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
ruby-1.9.2-p136 :001 > ['tatiana','ana lucia', 'sergio ney', 'marco aurelio' ] - ['tatiana','cantidio', 'marco aurelio', 'renata' ] | |
=> ["ana lucia", "sergio ney"] |
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
$ heroku help | |
=== General Commands | |
help # show this usage | |
version # show the gem version | |
login # log in with your heroku credentials | |
logout # clear local authentication credentials | |
list # list your apps |
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
refs: https://github.com/defunkt/resque | |
Instalar redis | |
Instalar resque | |
Gemfile: gem 'resque', 'versão', :require => 'resque/server' | |
Criar arquivo: | |
lib/tasks/resque.rake |
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
http://stackoverflow.com/questions/6085610/ruby-on-rails-and-rake-problems-uninitialized-constant-rakedsl | |
Rakefile | |
require 'rake' | |
require 'rake/dsl_definition' |
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
# aliases | |
# alias scripts="cd /Users/tatic/Dropbox/my_projects/myscripts; ls -la" | |
# alias freeports="scripts;ports >> ports.txt;ruby freeports.rb;rm ports.txt" | |
# by: TatiCarvalho 2012 | |
# In the command-line: freeports | |
# v1.1 |
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
‘Not all those who wander are lost.’ ~J.R.R. Tolkien (:zenhabits) | |
‘Bizarre travel plans are dancing lessons from God.’ ~Kurt Vonnegut (:zenhabits) | |
‘In proportion as he simplifies his life, the laws of the universe will appear less complex, and solitude will not be solitude, nor poverty poverty, nor weakness weakness.’ ~Henry David Thoreau (:zenhabits) | |
"É preciso viver, não apenas existir." (Plutarco) |
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
# This is a simple refactoring exercise. | |
# | |
# What to do? | |
# | |
# 1. Look at the code of the class CorrectAnswerBehavior | |
# 2. Try to see what it does by running `ruby refactoring_example.rb` | |
# 3. Record characterisation tests by running `ruby refactoring_example.rb --record` | |
# 4. Make the code beautiful;) | |
# 5. You are allowed to modify only the code between markers (REFACTORING START/REFACTORING END). | |
# 6. Test must pass! You can run them with command `ruby refactoring_example.rb --test` |
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
# This is a refactoring exercise. | |
# | |
# What to do? | |
# | |
# I. Simple refactoring | |
# 1. Look at the code of the class CorrectAnswerBehavior | |
# 2. Try to see what it does by running `ruby refactoring_example.rb` | |
# 3. Record characterisation tests by running `ruby refactoring_example.rb --record` | |
# 4. Make the code beautiful;) | |
# 5. You are allowed to modify only the code between markers (REFACTORING START/REFACTORING END). |
OlderNewer