Skip to content

Instantly share code, notes, and snippets.

View TWiStErRob's full-sized avatar

Róbert Papp TWiStErRob

View GitHub Profile
@ahulyk
ahulyk / AppComponen.kt
Last active August 19, 2020 11:41
Glide 4 inject custom OkHttp client using Dagger 2
@Singleton
@Component(
modules = [
NetModule::class,
AndroidInjectionModule::class,
GlideBuilderModule::class
]
)
interface AppComponent : AndroidInjector<App> {
@Takhion
Takhion / ExhaustiveWhen.kt
Last active July 28, 2021 19:19
Exhaustive `when` mapping in Kotlin
@file:Suppress("PackageDirectoryMismatch") // root package looks great when importing, ie. `import exhaustive`
/**
* Allows requiring an exhaustive mapping in a `when` block when used with the [rangeTo] operator.
* @sample [exhaustive_when_example]
*/
@Suppress("ClassName") // lowercase because it should look like a keyword
object exhaustive {
@ajambrovic
ajambrovic / protractorAPICheatsheet.md
Last active October 27, 2017 21:21 — forked from javierarques/protractorAPICheatsheet.md
Protractor API Cheatsheet
@sjudd
sjudd / RecyclerToListViewScrollListener
Last active September 21, 2018 18:19
RecyclerView scroll listener to AbsListView scroll listener
public class RecyclerToListViewScrollListener extends RecyclerView.OnScrollListener {
private final AbsListView.OnScrollListener scrollListener;
private int lastFirstVisible = -1;
private int lastVisibleCount = -1;
private int lastItemCount = -1;
public RecyclerToListViewScrollListener(AbsListView.OnScrollListener scrollListener) {
this.scrollListener = scrollListener;
}
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@willurd
willurd / web-servers.md
Last active April 28, 2024 21:38
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000