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
#!/usr/bin/ruby | |
# based on https://github.com/tmurakam/cashflow/blob/0a01ac9e0350dfb04979986444244f8daf4cb5a8/android/convertStrings.rb | |
# support comments and Converter such as "%@", "%d", "%0.1f"... | |
# in your directory : ./main.rb Localizable.strings | |
file = File.open("strings.xml", "w"); | |
file.puts "<?xml version=\"1.0\" encoding=\"utf-8\"?>" | |
file.puts "<resources>" |
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
//inside a fragment. If in an Activity you could use findViewById(Window.ID_ANDROID_CONTENT); | |
getView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() | |
{ | |
@Override | |
public void onGlobalLayout() | |
{ | |
//do something like measure a view etc | |
View content = getWindow().findViewById(Window.ID_ANDROID_CONTENT); | |
Log.d("DISPLAY", content.getWidth() + " x " + content.getHeight()); | |
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 MyWebView extends WebView | |
{ | |
public MyWebView(Context context) | |
{ | |
super(context); | |
} | |
public MyWebView(Context context, AttributeSet attrs) | |
{ | |
super(context, attrs); |
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
D/dalvikvm﹕ Late-enabling CheckJNI | |
E/jdwp﹕ Failed sending reply to debugger: Broken pipe | |
D/dalvikvm﹕ Debugger has detached; object registry had 1 entries | |
D//SpiceManager.java:212﹕ 16:20:13.876 main SpiceManager started. | |
V//SpiceManager.java:1183﹕ 16:20:13.877 SpiceManagerThread 0 Binding to service. | |
D//SpiceManager.java:483﹕ 16:20:13.881 main adding request to request queue | |
V//SpiceManager.java:1189﹕ 16:20:13.881 SpiceManagerThread 0 Binding to service succeeded. | |
D//SpiceManager.java:1236﹕ 16:20:13.887 SpiceManagerThread 0 Waiting for service to be bound. | |
D/dalvikvm﹕ GC_CONCURRENT freed 182K, 3% free 9243K/9460K, paused 2ms+2ms, total 22ms | |
D//SpiceService.java:127﹕ 16:20:13.924 main SpiceService instance created. |
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 final class GsonObjectPersister<T> extends InFileObjectPersister<T> | |
{ | |
// ============================================================================================ | |
// FIELDS | |
// ============================================================================================ | |
private final Gson gson; | |
// ============================================================================================ | |
// CONSTRUCTOR |
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
/** | |
* Allows easy swapping of production and test modules to satisfy Dagger dependencies | |
*/ | |
public class DaggerHelper | |
{ | |
//DAGGER | |
private static ObjectGraph sObjectGraph; | |
private static final List<Object> productionModules; |
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
byte aByte = -112; //0b1001_0000 | |
byte bByte = (byte) (aByte >> 4); //would expect 0b1111_1001 (-7) | |
System.out.println(bByte); //-7 | |
byte cByte = (byte) (aByte >>> 4); //would expect 0b0000_1001 (9) | |
System.out.println(cByte); //-7 |
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
### Keybase proof | |
I hereby claim: | |
* I am doridori on github. | |
* I am dori (https://keybase.io/dori) on keybase. | |
* I have a public key whose fingerprint is CC45 C7F9 5462 AD1D 729C CA47 83C4 30D2 BC60 9EB5 | |
To claim this, I am signing this object: |
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
//in your root build.gradle | |
//--------- Version Increment ----------// | |
//can call this like `./gradlew incrementVersionCode build` | |
task incrementVersionCode { | |
description = "Increments the version code in the version.properties file" | |
doLast { | |
File versionPropsFile = file('version.properties') |
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
#ps | |
USER PID PPID VSIZE RSS WCHAN PC NAME | |
root 1 0 4524 908 SyS_epoll_ 0000000000 S /init | |
shell 503 1 9952 700 0000000000 S /sbin/adbd | |
shell 17432 29176 5744 1156 0 7f8b5d6c7c R ps | |
shell 29176 503 5800 1444 sigsuspend 7f9663f37c S /system/bin/sh |
OlderNewer