Skip to content

Instantly share code, notes, and snippets.

View vinibaggio's full-sized avatar

Vinicius Baggio Fuentes vinibaggio

View GitHub Profile
class FacebookUser
def initialize(data)
@uid = data.uid
@first_name = data.info.first_name
@last_name = data.info.last_name
@email = data.info.email
@image = data.info.image
@urls = data.info.urls['Facebook']
@token = data.credentials.token
end
(1..10).each do |i|
puts i if i==3..i==5
end
# 3
# 4
# 5
@vinibaggio
vinibaggio / gist:2472759
Created April 23, 2012 18:03
Loja do vinibaggio

Loja do @vinibaggio

Vou vender minhas coisas pois estou de mudança e vou aproveitar pra limpar os armarios! Estou aberto à negociação! Mande seu item de interesse e sua proposta pra vinibaggio@gmail.com. Fotos também sob demanda.

Promoção de encerramento, 15% de desconto em tudo! Pedidos com envio por sedex apenas até hoje as 14h.

Tech

diff --git a/lib/rbraspag.rb b/lib/rbraspag.rb
index 1e5dfdc..512705e 100644
--- a/lib/rbraspag.rb
+++ b/lib/rbraspag.rb
@@ -4,7 +4,7 @@ require 'bundler'
Bundler.setup
-require "cs-httpi"
+require "httpi"
@vinibaggio
vinibaggio / gist:1727086
Created February 3, 2012 01:34
blocos malucos
bloco = -> {
vai_danada = 1
retorno = -> {
vai_danada += 1
}
vai_danada = 5
@vinibaggio
vinibaggio / gist:1727064
Created February 3, 2012 01:29
closure example
bla = 1
# => 1
proc = -> { bla = bla + 1; bla }
# => #<Proc:0x007fb67b276b98@(irb):2 (lambda)>
bla = 5
# => 5
function pless {
pygmentize -O encoding=UTF-8 $1 | less -r
}
defined?(a)
a = 1
puts a.inspect
function AkibaPlataformer(object) {
object.jump = function() {
return "Pula danada";
}
}
function Akiba(object) {
object.bla = function() {
return "Vai danada";
}
@vinibaggio
vinibaggio / spoj02.clj
Created January 6, 2012 18:51
Prime numbers
;; The input is:
;; first line: the number of test cases
;; next lines are the limits m n such as prime numbers are in [m;n]
;; Algorithm used: Sieve of Erasthotenes
(use '[clojure.set :only (difference)])
(defn mark
([all n limit]
(mark all n n limit))