Skip to content

Instantly share code, notes, and snippets.

View murano500k's full-sized avatar

Artem Radchenko murano500k

  • Kiev, Ukraine
View GitHub Profile
@murano500k
murano500k / apply-bundle.sh
Created September 20, 2016 13:41
scripts to generate bundle with diff between two branches for all projects in repoand apply it on existing repo
#!/bin/bash
if [ -z "$1" ];then
echo "Lack of parameters. Use: $0 [path_to_repo]"
echo "run from dir _changes_BRANCH1_not_BRANCH2"
exit
fi
PTH="$1"
WORKD=$(pwd)
REMOTE="$2"
temp_branch1="${WORKD%_not_*}"
@murano500k
murano500k / MainActivity.java
Created October 13, 2016 23:19
Rx background op
package rx.android.samples;
import android.app.Activity;
import android.os.Bundle;
import android.os.HandlerThread;
import android.os.Looper;
import android.util.Log;
import android.view.View;
import java.util.concurrent.TimeUnit;
import rx.Observable;
#! /bin/sh
SIZE_SYSTEM=1024
START_SYSTEM=81937
END_SYSTEM=`echo $START_SYSTEM+$SIZE_SYSTEM*1024 | bc`
END_CACHE=`echo $END_SYSTEM+512*1024 | bc`
echo SIZE_SYSTEM $SIZE_SYSTEM
echo START_SYSTEM $START_SYSTEM
echo END_SYSTEM $END_SYSTEM
echo END_CACHE $END_CACHE
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:padding="16dp"
>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cv"
@murano500k
murano500k / build.gradle
Created October 25, 2016 12:18
build.gradle root for project sample using time-tracker plugin
buildscript {
repositories {
// TODO(arthurthompson): mavenLocal() being used for preview but will be removed for release.
mavenLocal()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:3.0.0'
classpath "net.rdrei.android.buildtimetracker:gradle-plugin:0.8.0"
@murano500k
murano500k / build.gradle
Created November 9, 2016 15:03
debug and release apks simluteneously
buildTypes {
debug {
applicationIdSuffix ".debug"
}
// ...
}
@murano500k
murano500k / build.gradle
Created November 9, 2016 15:04
icepick
repositories {
maven {url "https://clojars.org/repo/"}
}
dependencies {
compile 'frankiesardo:icepick:{{latest-version}}'
provided 'frankiesardo:icepick-processor:{{latest-version}}'
}
//https://github.com/frankiesardo/icepick
@murano500k
murano500k / MyFragment.java
Created November 9, 2016 15:05
To keep fragment on screen rotate
in onCreate: setRetainInstance(true)
@murano500k
murano500k / build.gradle
Last active November 9, 2016 15:07
Dagger setup
root level:
dependencies {
// other classpath definitions here
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
app level:
// add after applying plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
dependencies {
@murano500k
murano500k / .bashrc
Created November 10, 2016 09:49
my bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac