Skip to content

Instantly share code, notes, and snippets.

View fltiago's full-sized avatar

Tiago Ferreira Lima fltiago

View GitHub Profile

O Redu está procurando nerds para trabalhar e se divertir na startup.

Para os interessados basta enviar para [email protected] com currículo/linkedin/github/lattes.

O que é obrigatório:

  • Ter fluência em uma ou mais das seguintes linguagens: Python, Ruby ou JavaScript
  • Ser mestre ou estar quase lá

Ganha ponto quem:

Instalando MySQL
Basta instalá-lo através do apt-get:
$ sudo apt-get install mysql-server mysql-client
$ sudo apt-get install libmysql-ruby libmysqlclient-dev
http://beginrescueend.com/rvm/install/
rvm install 1.9.3
rvm use 1.9.3
gem install rails --no-ri --no-rdoc
Failed examples:
rspec ./spec/models/course_spec.rb:777 # Course behaves like a billable when verifying members limit and plan is on course and plan has members limit should permit entry
rspec ./spec/models/licensed_invoice_spec.rb:114 # LicensedInvoice when calculating the amount updates to the correct amount
rspec ./spec/models/licensed_invoice_spec.rb:189 # LicensedInvoice when refreshing open licensed invoices should calculates invoice1's relative amount
rspec ./spec/models/license_spec.rb:56 # License retrievers retrieves all payable licenses
rspec ./spec/models/user_course_invitation_spec.rb:93 # UserCourseInvitation states when accept do NOT accept if it does not have a user
@fltiago
fltiago / References
Created May 10, 2012 16:51
Cross Domain Request
JSONP
-> http://en.wikipedia.org/wiki/JSONP
Cross-origin resource sharing
-> http://en.wikipedia.org/wiki/Cross-Origin_Resource_Sharing
http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/
@fltiago
fltiago / gist:3711346
Created September 13, 2012 01:50
Estrutura de Wally
Será composto pelos seguintes componentes:
Wall:
- items
- itemsTotal
- url
Activity
- actor
- object
require "debugger"
class Wally < Grape::API
format :json
helpers do
def current_user
@current_user ||= Author.find_by(token: params[:token])
end
describe Grape::API do
subject { Wally.new }
def app; subject end
...
context "GET wall by resource_id" do
context "when exist a wall" do
before do
class AuthorObserver < Untied::Consumer::Observer
observe :user, :from => :core
def after_create(author)
debugger
puts "Usuario criado!"
end
end
I, [2012-10-23T08:39:58.538847 #36521] INFO -- : Untied::Processor: processing event after_update from core with payload {:user=>{:languages=>nil, :gender=>nil, :friends_count=>0, :crypted_password=>"93cb231e482d795f1ee81ce41bf03bbb9d117da7", :avatar_file_name=>nil, :activation_code=>"3a96a528871660910c9e463211c0163f00aa9853", :current_login_ip=>nil, :created_at=>"2012-10-23T09:39:57-02:00", :birthday=>"1999-10-23T09:39:55-02:00", :updated_at=>"2012-10-23T09:39:57-02:00", :role=>2, :removed=>false, :oauth_token=>nil, :notify_messages=>true, :mobile=>nil, :avatar_id=>nil, :single_access_token=>"uVQR9zOAryIMItqG9LpD", :email=>"[email protected]", :persistence_token=>"ccb5769ae4e446bb13f9b7bd459375926ce86d5c6386a3f4a6f508cea46ecb6ab65fee46d17d3c8ebb7d6e2dad1782b67ee5ad19699aef8483c2a6c7b293aac0", :first_name=>"Usuário 2", :birth_localization=>nil, :avatar_updated_at=>nil, :activated_at=>nil, :zip=>nil, :login_count=>0, :password_salt=>"r9VdzRmoQjO7xtrBfbTt", :oauth_secret=>nil, :notify_followships=>true, :local