Skip to content

Instantly share code, notes, and snippets.

@kamilZ
kamilZ / xdebug-install-php7
Created December 5, 2015 00:10
Install xdebug from sources php7.0
sudo apt-get install php7.0-dev
wget http://xdebug.org/files/xdebug-2.4.0rc2.tgz
tar -xzf xdebug-2.4.0rc2.tgz
cd xdebug-2.4.0RC2/
phpize
./configure --enable-xdebug
make
sudo cp modules/xdebug.so /usr/lib/.
#FOR FPM
sudo echo 'zend_extension="/usr/lib/xdebug.so"' > /etc/php/7.0/fpm/conf.d/20-xdebug.ini
@kamilZ
kamilZ / GsonUtil.java
Created November 19, 2015 15:35
Gson util class when you using gson with realm
import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import io.realm.RealmObject;
public class GsonUtil {
public static Gson getInstance(){
@kamilZ
kamilZ / gist:8ceec99b04817026c946
Created July 1, 2014 10:58
TestFairy task to upload all release product flavors.
task testfairyAllRelease << {
android.productFlavors.all { theProductFlavor ->
tasks.getByName("testfairy${theProductFlavor.name.capitalize()}Release").execute()
}
}
testfairyAllRelease.dependsOn assembleRelease
@kamilZ
kamilZ / gist:8519003
Created January 20, 2014 12:15
Darken Android color.
public static int darken(int color, double fraction) {
int red = (int) Math.round(Math.max(Color.red(color) + 255 * fraction,255));
int green = (int) Math.round(Math.max( Color.green(color) + 255 * fraction,255));
int blue = (int) Math.round(Math.max( Color.blue(color) + 255 * fraction,255));
int alpha = Color.alpha(color);
return Color.argb(alpha, red, green, blue);
@kamilZ
kamilZ / gist:8518939
Last active January 3, 2016 20:59
Android darken color.
public static int brighten(int color, double fraction) {
int red = (int) Math.round(Math.max(0,Color.red(color) - 255 * fraction));
int green = (int) Math.round(Math.max(0,Color.green(color) - 255 * fraction));
int blue = (int) Math.round(Math.max(0,Color.blue(color) - 255 * fraction));
return Color.argb(Color.alpha(color);, red, green, blue);
}