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
# core {{{ | |
[core] | |
excludesfile = ~/.gitignore_global | |
pager=less -x4 | |
quotepath = false | |
pager = less | |
autocrlf = input | |
#}}} | |
# user {{{ |
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
private static WeakReference<RenderScript> rsRef = new WeakReference<>(null); | |
private static WeakReference<ScriptIntrinsicBlur> blurScriptRef = new WeakReference<>(null); | |
/** | |
* Use {@link RenderScript} to blur bitmap. | |
* | |
* @param bitmap to be blurred | |
* @param radius of blur | |
* @throws RSRuntimeException when some .so libs are not available (e.g. on Genymotion emulator) | |
*/ |
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 | |
# Script for getting database form device via adb and open in sqlite_client(work with not rooted devices) | |
# | |
# While you aren't breaking script execution(CTLR+C), | |
# each closing of sqlite_client will be download and open database again and again. | |
# | |
# Note: if you don't have installed sqliteman override sqlite_client variable with your favorite client | |
# | |
# Usage: open_db.sh {app_package} {db_name} {app} |
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 PositionResizeAnimator { | |
public static Animator createAnimator(Holder srcHolder, Holder targetHolder, final View animateView) { | |
ValueAnimator heightAnimator = ValueAnimator.ofInt(srcHolder.height, targetHolder.height); | |
heightAnimator.addUpdateListener( | |
new ValueAnimator.AnimatorUpdateListener() { | |
@Override | |
public void onAnimationUpdate(ValueAnimator animation) { | |
int val = (Integer) animation.getAnimatedValue(); | |
ViewGroup.LayoutParams layoutParams = animateView.getLayoutParams(); |
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 FixedSwitchPreference extends SwitchPreference { | |
/** | |
* Construct a new SwitchPreference with the given style options. | |
* | |
* @param context The Context that will style this preference | |
* @param attrs Style attributes that differ from the default | |
* @param defStyle Theme attribute defining the default style options | |
*/ | |
public FixedSwitchPreference(Context context, AttributeSet attrs, int defStyle) { |
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 ObjectGsonParceler { | |
private final Gson gson; | |
public ObjectGsonParceler(Gson gson) { | |
this.gson = gson; | |
} | |
public Parcelable wrap(Object instance) { | |
try { | |
String json = encode(instance); |
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
package your.package; | |
import android.graphics.Bitmap; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.support.annotation.NonNull; | |
import android.widget.ImageView; | |
public abstract class AndroidPaletteCallback extends PaletteCallback<ImageView> { | |
public AndroidPaletteCallback(@NonNull ImageView imageView) { |
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
angular.module("services").factory('ModalUrl', [ | |
'$rootScope', '$modal', '$location', '$routeParams', '$window', '$timeout', | |
($rootScope, $modal, $location, $routeParams, $window, $timeout) -> | |
modalInstance = null | |
checkModal = () -> | |
modalParam = decodeURIComponent($routeParams.modal) | |
if (modalParam != 'undefined') | |
optionsParam = decodeURIComponent($routeParams.options) | |
if (optionsParam != 'undefined') | |
options = JSON.parse(optionsParam) |
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 static Intent newSmsIntent(Context context, String body, String... phoneNumber) { | |
Uri smsUri; | |
if (phoneNumber == null) { | |
smsUri = Uri.parse("smsto:"); | |
} else { | |
smsUri = Uri.parse("smsto:" + Uri.encode(TextUtils.join(",", phoneNumber))); | |
} | |
Intent intent; | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | |
intent = new Intent(Intent.ACTION_SENDTO, smsUri); |
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
/* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2016 Piasy | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |