This file contains 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
Fixnum.class_eval do | |
def primo? | |
return true if self == 1 #"primo" | |
return false if self.nil? | |
number = self.abs | |
div = 0 | |
number.downto(1) do |n| | |
if number % n == 0 then | |
div = div+1 | |
end |
This file contains 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
set :application, "myapp" | |
set :keep_releases, 5 | |
# git options | |
set :scm, "git" | |
set :repository, "git://github.com/georgeguimaraes/myapp.git" | |
set :branch, "master" | |
set :deploy_via, :remote_cache | |
# deploy credentials |
This file contains 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
### | |
# lolquery is an fresh new take on SQL DSLs. NEVER WRITE SQL AGAIN! Using | |
# amazing lolquery technology, you too will never have to write another SQL | |
# statement again! | |
# | |
# Check out this simple example of using lolquery. Bask in it's simplicity, | |
# it's expressiveness, but most importantly, it's lack of writing SQL! | |
# | |
# <3 <3 <3 <3 <3 |
This file contains 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
context 'verificar a quantidade prevista de cachos' do | |
# Como usuario quero verificar a quantidade prevista de cachos a colher na semana | |
it 'cachos que podem ser colhidos' do | |
@bunch = Bunch.find(:all, :conditions => [ "created_at <= ?", 12.week.ago] ) | |
@bunch.shoud be_colhivel | |
end | |
end |
This file contains 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
describe Bunch do | |
before(:each) do | |
@bunch = Factory.build(:bunch) | |
end | |
context 'verificar a quantidade prevista de cachos' do | |
# Como usuario quero verificar a quantidade prevista de cachos a colher na semana | |
# recebe o dia e com base na semana procura todos os cachos previstos pra colheita. |
This file contains 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
#ap/model/bunch.rb | |
def excisable? | |
created_at <= 12.weeks.ago | |
end | |
#bunch_spec.rb | |
require 'spec_helper' | |
describe Bunch do | |
before(:each) do |
This file contains 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
"pt-BR": | |
models: | |
bunch: "cacho" | |
attributes: | |
bunch: | |
production_unit_id: "unidade de produção" | |
release: "data lançamento" | |
bunch_amount: "quantidade de cachos cortados" | |
user_id: "id usuario" | |
created_at: "Log data/hora" |
This file contains 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
function makeAdder(x){ | |
return function(y){ | |
return x+y; | |
}; | |
} | |
var add5 = makeAdder(5); | |
var add10 = makeAdder(10); | |
alert(add5(2)); | |
alert(add10(2)); |
This file contains 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 make | |
return lambda do |x| | |
return lambda do |y| | |
return x + y | |
end | |
end | |
end | |
puts make.call(1).call(2) |
This file contains 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
if has("gui_running") | |
if has("gui_gnome") | |
"set term=gnome-256color "MUDO ESSA LINHA | |
set t_Co=256 "ACRESCENTO ESSA | |
colorscheme railscasts2 | |
set guifont=Monaco\ Bold\ 12 | |
endif | |
else | |
let g:CSApprox_loaded = 1 |
OlderNewer