I hereby claim:
- I am r0adkll on github.
- I am r0adkll (https://keybase.io/r0adkll) on keybase.
- I have a public key whose fingerprint is 2BDD 0597 7238 19D0 0075 18FB FEEE 9236 FBB6 9F6B
To claim this, I am signing this object:
//auto versioning logic | |
def versionPropertiesFile = file('version.properties') | |
if (versionPropertiesFile.canRead()) { | |
def Properties properties = new Properties() | |
properties.load(new FileInputStream(versionPropertiesFile)) | |
def build = properties['BUILD'].toInteger() + 1 | |
properties['BUILD'] = build.toString() | |
properties.store(versionPropertiesFile.newWriter(), null) | |
defaultConfig { |
/** | |
* Dev tools and the play store (and others?) launch with a different intent, and so | |
* lead to a redundant instance of this activity being spawned. <a | |
* href="http://stackoverflow.com/questions/17702202/find-out-whether-the-current-activity-will-be-task-root-eventually-after-pendin" | |
* >Details</a>. | |
*/ | |
private boolean isWrongInstance() { | |
if (!isTaskRoot()) { | |
Intent intent = getIntent(); | |
boolean isMainAction = intent.getAction() != null && intent.getAction().equals(ACTION_MAIN); |
<RelativeLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" > | |
<android.support.v7.widget.Toolbar | |
android:id="@+id/appbar" | |
android:layout_height="wrap_content" | |
android:layout_width="match_parent" | |
android:minHeight="?attr/actionBarSize" | |
android:elevation="6dp" |
String nickName; | |
try { | |
Cursor c = getActivity().getContentResolver().query(ContactsContract.Profile.CONTENT_URI, null, null, null, null); | |
c.moveToFirst(); | |
nickName = c.getString(c.getColumnIndex("display_name")).concat("'s Android"); | |
c.close(); | |
}catch (Exception e){ | |
Timber.e("Unable to load user's contact information, reverting to default device name"); | |
nickName = Build.MANUFACTURER + " - " + Build.PRODUCT; | |
} |
private static float mCurrentBatteryPct; | |
private static long mCurrentBatteryPctDateMs; | |
/** | |
* A flavor of {@link #getCurrentBatteryLevel(Context)} that only polls the battery level from the OS | |
* every once in a while in an attempt to limit battery drain vs battery data freshness. | |
* | |
* @param readingPeriodMs the reading period (ms) | |
* @return the current battery level(%) |
<?php | |
/*************************************************************************************************** | |
* | |
* Step 1: Save the sent file locally on the server | |
* | |
*/ | |
$file_name = basename($_FILES["file"]["name"]); | |
$target_file = "images/".basename($_FILES["file"]["name"]); | |
if (move_uploaded_file($_FILES["file"]["tmp_name"], $target_file)) { |
/** | |
* Apply kerning to a string | |
* | |
* @param src the source string | |
* @param kerning the amount of kerning | |
* @return the spannable output | |
*/ | |
public static Spannable applyKerning(CharSequence src, float kerning) { | |
if (src == null) return null; | |
final int srcLength = src.length(); |
I hereby claim:
To claim this, I am signing this object:
/* | |
* Copyright © 52inc 2015. | |
* All rights reserved. | |
*/ | |
apply plugin: 'org.ajoberstar.grgit' | |
import groovy.json.* | |
def versionFile = file("../version.json") |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import com.squareup.picasso.Transformation; | |
public class ShadeTransform implements Transformation { | |
/* The shade alpha of black to apply */ |