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
public class ExpandableLayoutManager extends LinearLayoutManager { | |
public ExpandableLayoutManager(Context context, int orientation, boolean reverseLayout) { | |
super(context, orientation, reverseLayout); | |
} | |
private int[] mMeasuredDimension = new int[2]; | |
@Override | |
public void onMeasure(RecyclerView.Recycler recycler, RecyclerView.State state, |
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
org.gradle.jvmargs=-Xmx2048m -XX\:MaxPermSize\=512m -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding\=UTF-8 | |
org.gradle.daemon=true | |
org.gradle.configureondemand=true% | |
org.gradle.parallel=true |
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
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running? | |
E/AndroidRuntime(29449): at android.view.ViewRootImpl.setView(ViewRootImpl.java:579) | |
E/AndroidRuntime(29449): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:272) | |
E/AndroidRuntime(29449): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69) | |
E/AndroidRuntime(29449): at android.widget.MediaController.show(MediaController.java:354) | |
E/AndroidRuntime(29449): at android.widget.MediaController.show(MediaController.java:314) | |
E/AndroidRuntime(29449): at com.globo.player.Player.showMediaControls(Unknown Source) | |
E/AndroidRuntime(29449): at com.globo.player.Player.c(Unknown Source) | |
E/AndroidRuntime(29449): at com.globo.player.d.start(Unknown Source) | |
E/AndroidRuntime(29449): at com.globo.player.d.onPrepared(Unknown Source) |
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"]]; |
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
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
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
# 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
# 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 |
NewerOlder