Skip to content

Instantly share code, notes, and snippets.

View vgaidarji's full-sized avatar
🚀
:shipit:

Veaceslav Gaidarji vgaidarji

🚀
:shipit:
View GitHub Profile
@vgaidarji
vgaidarji / AndroidManifest.xml
Created June 27, 2016 18:05 — forked from billmote/AndroidManifest.xml
When pushing code from your IDE, wake the device and show the activity.
<?xml version="1.0" encoding="utf-8"?>
<!-- Add this as a debug manifest so the permissions won't be required by your production app -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
</manifest>
@vgaidarji
vgaidarji / RxJava.md
Created September 15, 2016 12:36 — forked from cesarferreira/RxJava.md
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
@vgaidarji
vgaidarji / checkstyle.gradle
Created October 10, 2016 12:59 — forked from kboyarshinov/checkstyle.gradle
Code quality gradle scripts for Android
/**
* Checkstyle tasks
* Usage:
* - place this file under root dir of your project at /gradle directory
* - apply script from your gradle file:
* apply from : "{rootDir}/gradle/checkstyle.gradle"
*
* To configure checkstyle use configs at:
* "{rootDir}/config/checkstyle/checkstyle.xml" - for main projects
* "{rootDir}/config/checkstyle/checkstyle-test.xml" - for tests
@vgaidarji
vgaidarji / AndroidStudio as git difftool, mergetool
Last active March 13, 2020 09:23
Use AndroidStudio as git difftool/mergetool on MacOS (place this inside your ~/.gitconfig).
[merge]
tool = studio
[mergetool "studio"]
prompt = false
cmd = /Applications/Android\\ Studio.app/Contents/MacOS/studio merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
[diff]
tool = studio
[difftool "studio"]
prompt = false
@vgaidarji
vgaidarji / theme-son-of-obsidian.css
Created February 12, 2017 18:00
Son of Obsidian rouge theme
pre.highlight,
.highlight pre { background-color: #272822; }
.highlight .hll { background-color: #22282A }
.highlight .c { color: #99AA8A } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #93C763 } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #F1F2F3 } /* Name */
.highlight .o { color: #E8E2B7 } /* Operator */
.highlight .p { color: #F1F2F3 } /* Punctuation */
@vgaidarji
vgaidarji / update-git-user-in-sub-dirs.sh
Last active June 26, 2018 12:23
Update Git user name in sub-directories
#!/usr/bin/env sh
USER_NAME="Veaceslav Gaidarji"
USER_EMAIL="veaceslav.gaidarji@gmail.com"
echo "Using config: \n user.name=$USER_NAME, \n user.email=$USER_EMAIL\n"
for dir in */;
do
cd $dir
@vgaidarji
vgaidarji / build.prop
Created April 26, 2017 18:19 — forked from CHEF-KOCH/build.prop
Android Build.prop tweaks <- FOR ALL AOSP ROMS (4.0.x - 5.0.x) ->
# Begin build properties
# EOL UNIX
# 0.0 644 /system/build.prop
#
# Note: Some changes are Device and OS/ROM independent!
# Note2: Some settings are between
# performance and security <- I prefer last one
#
ro.build.id= -----
ro.build.display.id= -----
@vgaidarji
vgaidarji / show-git-remote-ages.sh
Created May 19, 2017 09:01
Script which lists remote branches by age and includes some related information to identify last author and any branch names.
#!/bin/sh
exec git branch -r | cut -d' ' -f3 | xargs git show --pretty='%Cgreen%ai %Creset%h %an %d' -s | sed '/^$/d' | sort | uniq
@vgaidarji
vgaidarji / sdkmanager-accept-licenses.sh
Created May 31, 2017 16:39
Update Android sdkmanager licenses automatically
#!/bin/bash
/usr/bin/expect -c '
set timeout -1;
spawn '"${ANDROID_HOME}"'/tools/bin/sdkmanager --licenses;
expect {
"y/N" { exp_send "y\r" ; exp_continue }
eof
}
'
@vgaidarji
vgaidarji / collapsed-markdown-section
Created June 12, 2018 13:24
Collapsed markdown section
<details><summary>Collapsed section</summary><p>
```
```
</p></details>