Skip to content

Instantly share code, notes, and snippets.

View skoric's full-sized avatar
🏠
Working from home

Ivan Škorić skoric

🏠
Working from home
View GitHub Profile
/**
* * New version: 30/May/2017
* * Made it more kotlin-like with same functionality ^^
*
* based on: https://gist.github.com/RomansBermans/6f3836188427fbd3b1efcf7e6418f06d
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
@staltz
staltz / introrx.md
Last active April 29, 2024 09:25
The introduction to Reactive Programming you've been missing
anonymous
anonymous / download_apk.sh
Last active March 23, 2024 15:54
Bash script for pulling APK's from Non-rooted android devices
#!/bin/sh
if test $# -lt 1 ; then
echo "Usage: download_apk.sh <GooglePlayPackageName>"
exit 1
fi
PACKAGE=$1
APK_PATH=`adb shell pm list packages -f -3 | grep $PACKAGE | cut -d'=' -f 1 | cut -c9-`
echo "Pulling $APK_PATH from device"
echo `adb pull ${APK_PATH} ./${PACKAGE}.apk`
@granoeste
granoeste / EachDirectoryPath.md
Last active April 4, 2024 22:32
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories