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
class Relatorio | |
attr_reader :titulo, :texto | |
attr_accessor :formatter | |
def initialize(&formatter) | |
@titulo = 'Relatorio Mensal' | |
@texto = [ 'Gastos do mês', 'contas, e mais contas.' ] | |
@formatter = formatter | |
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
module Subject | |
def initialize | |
@observers=[] | |
end | |
def add_observer(&observer) | |
@observers << observer | |
end | |
def delete_observer(observer) | |
@observers.delete(observer) | |
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
$(document).ready(function() { | |
/* =Reflection -------------------------------------------------------------------------- */ | |
$("#nav-reflection li").append("<span></span>"); | |
$("#nav-reflection a").hover(function() { | |
$(this).stop().animate({ marginTop: "-10px" }, 200); | |
$(this).parent().find("span").stop().animate({ marginTop: "18px", opacity: 0.25 }, 200); |
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
gem install haml sass will_paginate memcache-client rufus-scheduler javan-whenever sinatra mysql2 devise nifty-generators restfulie thinking-sphinx simplecov factory_girl_rails capybara database_cleaner cucumber-rails cucumber spork launchy rspec-rails ZenTest test_notifier autotest-notification --pre | |
gem install haml sass will_paginate memcache-client rufus-scheduler javan-whenever sinatra mysql2 devise nifty-generators restfulie thinking-sphinx simplecov factory_girl_rails capybara database_cleaner cucumber-rails cucumber spork launchy rspec-rails ZenTest test_notifier autotest-notification hpricot paperclip |
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
require 'rubygems' | |
gem 'twitter' | |
require 'twitter' | |
require 'open-uri' | |
require 'find' | |
user_name = "anderson_leite" | |
image_url = Twitter.user(user_name).profile_image_url |
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
require 'omniauth/oauth' | |
require 'multi_json' | |
module OmniAuth | |
module Strategies | |
# | |
# Authenticate to orkut via OAuth and retrieve basic user info. | |
# | |
# Usage: | |
# |
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
// Retrofit Interface | |
@GET("/group/{id}/users") | |
List<User> groupList(@Path("id") int groupId); | |
// Chamada ao Endpoint com retorno em JSON | |
RestAdapter restAdapter = new RestAdapter.Builder() | |
.setEndpoint("https://api.github.com") | |
.setRequestInterceptor(requestInterceptor) | |
.build(); |
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
@GET("/user/{id}/photo") | |
Observable<Photo> getUserPhoto(@Path("id") int id); |
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
public class House implements Parcelable { | |
private Integer rooms; | |
private String color; | |
protected House(Parcel in) { | |
rooms = in.readByte() == 0x00 ? null : in.readInt(); | |
color = in.readString(); | |
} |
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 myVar = {String str, int num -> println "$str : $num" } | |
//execute closure | |
myVar('age', 30) | |
#output: age : 30 |
OlderNewer