This file contains hidden or 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
namespace :git do | |
task :sent, :message, :repo do |t, args| | |
if args[:message].nil? | |
puts "You must define a message for the commit, example => rake git:commit['MyMessage']".colored.red | |
else | |
puts "Adding files, Commiting and pushing..".colored.yellow | |
exec("git add . && git add -u && git commit -m '#{args[:message]}' && git push #{args[:repo]}") | |
puts "All files sent to remote repository: #{:repo}".colored.green |
This file contains hidden or 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 --http-proxy http://usuario:login@ip:porta rails |
This file contains hidden or 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
export http_proxy="http://username:password@ip:porta" |
This file contains hidden or 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
<!-- Add the following lines to theme's html code right before </head> --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script> | |
<!-- | |
Usage: just add <div class="gist">[gist URL]</div> | |
Example: <div class="gist">https://gist.github.com/1395926</div> | |
--> |
This file contains hidden or 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
# download the last release of FirefoxOS here: http://www.rodrigopadula.com/arquivos/Keon-%20FirefoxOS%201.0.1.0-prerelease.tar.gz | |
Now, the commands | |
# Install the ADB and fastboot | |
sudo add-apt-repository ppa:nilarimogard/webupd8 | |
sudo apt-get update | |
sudo apt-get install android-tools-adb android-tools-fastboot | |
sudo adb reboot recovery # reboot your device in recovery mode |
This file contains hidden or 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
# Com Ruby 1.9 | |
BANDS = [:the_strokes, :black_keys, :arctic_monkeys] | |
# Agora, com Ruby 2.0 | |
BANDS = %i[the_strokes black_keys, arctic_monkeys] |
This file contains hidden or 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 Person | |
attr_accessor :name, :age | |
end | |
@person = Pessoa.new | |
@person.name = "Pedro Nicholas" | |
@person.age = 21 | |
@person.to_h | |
#=> {:name => "Pedro Nicholas", :age => 21} |
This file contains hidden or 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 String | |
def say_hi | |
"Hi #{self}!" | |
end | |
end | |
class MinhaClasse | |
puts "Pedro".say_hi | |
end |
This file contains hidden or 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
[user] | |
name = <seu_nome> | |
email = <seu_email> | |
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] |
This file contains hidden or 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
#import "NSDate+Extensions.h" | |
@implementation NSDate (Extensions) | |
- (NSDate *)dateByMovingToBeginningOfDay { | |
unsigned int flags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | | |
NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit; | |
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; | |
// [calendar setLocale:[NSLocale currentLocale]]; | |
[calendar setTimeZone:[NSTimeZone timeZoneWithName:@"America/Sao_Paulo"]]; |
OlderNewer