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
@OnTextChanged(value = R.id.editText, callback = AFTER_TEXT_CHANGED) void afterTextChanged( | |
Editable editable) { | |
for (int x = 0; x < mTextContainer.getChildCount(); x++) { | |
TextView tv = (TextView) mTextContainer.getChildAt(x); | |
if (x < editable.length()) { | |
tv.setText(editable.charAt(x) + ""); | |
} else { | |
tv.setText("_"); | |
} | |
} |
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
#!/bin/sh | |
## | |
# This is a script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# Run in interactive mode with: | |
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)" | |
# | |
# or run it without prompt questions: |
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
import android.app.Activity; | |
import android.os.Bundle; | |
import android.os.Parcel; | |
import android.os.Parcelable; | |
import android.util.Log; | |
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
import com.google.gson.JsonArray; | |
import com.google.gson.JsonElement; | |
import com.google.gson.JsonObject; |
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 MyClass extends FragmentActivity { | |
/** | |
* | |
* Simple Fragment management. Lets you easily add Fragments. | |
* | |
* @param fragment Fragments to be added on top of the stack | |
* @param tag The Fragments tag. Can be null. | |
* @param clearStack If true, it will clear all existing Fragments from the | |
* stack. | |
*/ |
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
// Adb with your Logger TAG | |
adb logcat -s 'MyTag' | |
// Logging A Message | |
Logger.i("Tag1", "Something just happend!"); | |
Logger.i("Tag1", "Blah"); | |
Logger.i("Tag2", "Oh"); | |
Logger.i("Tag1", "Hi"); | |
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
# Cleans up the left side of the page | |
facebook.com##div[id*="pagesNav"] | |
facebook.com##div[id*="appsNav"] | |
facebook.com##div[id*="developerNav"] | |
facebook.com##div[id*="interestsNav"] | |
facebook.com##div[id*="listsNav"] | |
facebook.com##div[id*="pagelet_reminders"] | |
facebook.com##div[id*="pagelet_ego_pane_w"] | |
facebook.com##div[id*="pagelet_rhc_footer"] | |
facebook.com##div[id*="pagelet_friends_online"] |
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 Log { | |
public static void d (final String format, final Object... params) { | |
if (BuildConfig.DEBUG) { | |
android.util.Log.d(getTagFromStackTrace(), String.format(format, params)); | |
} | |
} | |
public static void d (final Throwable e) { | |
if (BuildConfig.DEBUG) { |
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
FATAL EXCEPTION | |
java.lang.RuntimeException: Could not get input device information. | |
at android.hardware.input.InputManager.getInputDevice(InputManager.java:221) | |
at android.view.KeyCharacterMap.load(KeyCharacterMap.java:334) | |
at android.view.KeyEvent.getKeyCharacterMap(KeyEvent.java:2729) | |
at android.view.KeyEvent.getUnicodeChar(KeyEvent.java:2786) | |
at android.view.KeyEvent.getUnicodeChar(KeyEvent.java:2762) | |
at android.view.ViewRootImpl.isTypingKey(ViewRootImpl.java:5610) | |
at android.view.ViewRootImpl.checkForLeavingTouchModeAndConsume(ViewRootImpl.java:5648) | |
at android.view.ViewRootImpl.access$1500(ViewRootImpl.java:139) |
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
import java.io.IOException; | |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import android.graphics.Bitmap; | |
import android.graphics.Matrix; | |
import android.os.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
public final class StorageUtil { | |
public static enum Storage { | |
/** | |
* /data/data/com.my.package/data/files/ | |
*/ | |
INTERNAL, | |
/** |
OlderNewer