Skip to content

Instantly share code, notes, and snippets.

View vinibaggio's full-sized avatar

Vinicius Baggio Fuentes vinibaggio

View GitHub Profile
@vinibaggio
vinibaggio / gist:1566379
Created January 5, 2012 17:58
Doubling all the numbers
;; I have a sequence and I want to double all the numbers up to a limit. The following works, but looks awful!
;; (defn double-all [numbers limit]
;; (for [val numbers :when (< (* 2 val) limit) ] (* 2 val)))
(defn double-all [numbers limit]
(filter #(> limit %) (map #(* 2 %) numbers)))
(double-all (range 20) 10)
@vinibaggio
vinibaggio / arvoreb.c
Created November 20, 2011 20:22
Arvore B, sem remoção, apenas inserção
// PS: Datasets:
// http://dl.dropbox.com/u/3545192/cep.zip
// http://dl.dropbox.com/u/3545192/consultas.txt
/* SCE-183 - Algoritmos e estruturas de dados II
* Professora: Prof.a Dr.a Hosiane M. Bueno
*
* Trabalho 2: ¡rvore-B
*
* Autor: VinÌcius Baggio Fuentes
@vinibaggio
vinibaggio / exemplo.css
Created October 10, 2011 02:09
Exemplo de bg com gradiente
html { min-height: 100%; }
body {
width: 600px;
margin: auto;
background: #1e1e1e;
background-image: url('textura.png');
background-image: url('textura.png'), -webkit-gradient(linear, left top, left bottom, from(rgba(100, 100, 100, 0.2)), to(rgba(0, 0, 0, 0.5))); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient(top, rgba(100, 100, 100, 0.2), rgba(0, 0, 0, 0.5)), url('textura.png'); /* Chrome 10+, Saf5.1+ */
module Support
module Login
def login(user=nil)
user ||= users(:user)
visit new_session_path
# ...
end
end
end
@vinibaggio
vinibaggio / Gemfile
Created June 20, 2011 20:19
Guard + spork
group :test do
gem 'guard-spork'
gem 'guard-rspec'
gem 'growl'
gem 'rb-fsevent'
end
guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' }, :cucumber => false do
watch('config/application.rb')
watch('config/environment.rb')
watch(%r{^config/environments/.+\.rb$})
watch(%r{^config/initializers/.+\.rb$})
watch('spec/spec_helper.rb')
end
guard 'rspec', :cli => '--drb' do
watch(%r{^spec/.+_spec\.rb})
Factory.define :user do |u|
u.email 'bla@bla.com'
end
grupos que sei da existência:
* Guru-SP
  * Guru-SP-Interior
* Guru-Campinas (SP)
  * Guru-CE
  * Guru-PI
  * Rails-MG 
  * Guru-SC
* Guru-BA
require 'net/imap'
Net::IMAP.debug = true
imap = Net::IMAP.new('imap.gmail.com', :ssl => true)
imap.login('login', 'senha')
imap.select('INBOX')
loop do
seqno = nil
"pt-BR":
errors:
messages:
not_found: "não encontrado"
already_confirmed: "já foi confirmado"
not_locked: "não foi bloqueado"
not_saved:
one: '1 erro impediu que %{model} fosse gravado:'
other: '%{count} erros impediram que %{model} fosse gravado:'