Skip to content

Instantly share code, notes, and snippets.

View ShkurtiA's full-sized avatar

Armando TBA ShkurtiA

  • Illyria
View GitHub Profile
@ShkurtiA
ShkurtiA / speak.gradle
Created February 16, 2021 14:52 — forked from etiennestuder/speak.gradle
Voice notification when when Gradle build finishes (for Mac OS X)
// When runnning a Gradle build in the background, it is convenient to be notified immediately
// via voice once the build has finished - without having to actively switch windows to find out -
// and being told the actual exception in case of a build failure.
// Put this file into the folder ~/.gradle/init.d to enable the acoustic notifications for all builds
gradle.addBuildListener(new BuildAdapter() {
@Override
void buildFinished(BuildResult result) {
@ShkurtiA
ShkurtiA / android-tools
Last active June 5, 2020 12:09
android tools
https://github.com/KnIfER/AndroidVectorPathTweaker Android SVG Vector Modify Plugin
https://github.com/alexjlockwood/avocado Vector Drawable optimization tool
Running activities (most recent first): adb shell dumpsys activity activities | grep Activity --color
gradle build details: gradle --scan
@ShkurtiA
ShkurtiA / drugs_and_alcohol.md
Last active July 18, 2023 20:30
Fahrschule, driving license germany, berlin

Drugs and Alcohol

How is the intoxicating substance in hashish broken down by the body?

  • Unevenly over an indeterminate period

In general, how long does it take before an alcohol level of 1.0 per mille (100mg/100ml) is cleared from the blood stream?

  • 5 hours
  • 10 hours
  • 1 hour
https://android.googlesource.com/platform/frameworks/base/+/969c243/docs/html/training/connect-devices-wirelessly/wifi-direct.jd
https://android.googlesource.com/platform/development/+/master/samples/WiFiDirectDemo/AndroidManifest.xml?autodive=0%2F
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> (permission needed to find nearby peers)
https://developer.android.com/reference/android/net/wifi/WpsInfo.html#PBC
WpsInfo.PBC is deprecated only after api 28
Observable.just(1) // 1 will be emited in the IO thread pool
.subscribeOn(Schedulers.io())
.flatMap(...) // will be in the IO thread pool
.observeOn(Schedulers.computation())
.flatMap(...) // will be executed in the computation thread pool
.observeOn(AndroidSchedulers.mainThread())
.subscribe(); // will be executed in the Android main thread (if you're running your code on Android)
@ShkurtiA
ShkurtiA / Rx2 Kotlin Extension
Created January 29, 2018 13:07
Rxjava2 kotlin extension
fun <T> Flowable<T>.applySchedulersIO(): Flowable<T> {
return subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
}
fun <T> Flowable<T>.applySchedulersComputation(): Flowable<T> {
return subscribeOn(Schedulers.computation()).observeOn(AndroidSchedulers.mainThread())
}
fun <T> Flowable<T>.subscribeUIToIO(onNext: (T) -> Unit, onError: (Throwable) -> Unit): Disposable {
return applySchedulersIO().subscribe({ next ->
@ShkurtiA
ShkurtiA / RVAdapterDelegate
Last active October 9, 2018 13:47
Adapter delegate implementation example
class OverviewAdapter(val list: List<DisplayableItem>, clickListener: OnItemClickListener) : ListDelegationAdapter<List<DisplayableItem>>() {
init {
delegatesManager.addDelegate(PhotoItemDelegate(clickListener))
delegatesManager.addDelegate(ButtonItemDelegate(clickListener))
setItems(list)
}
}
class PhotoItemDelegate(private val clickListener: OnItemClickListener) : AbsListItemAdapterDelegate<PhotoItem, DisplayableItem, PhotoItemDelegate.ViewHolder>() {
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';