Skip to content

Instantly share code, notes, and snippets.

NikolaDespotoski /
Last active March 21, 2020 05:11
Cursor Diff Util callback.
import android.database.Cursor;
* Created by Nikola on 9/29/2016.
public abstract class CursorCallback<C extends Cursor> extends DiffUtil.Callback {
private final C newCursor;
kaushikgopal /
Last active February 2, 2022 07:28
Notes on opportune moments to do "stuff" in the Android Lifecycle
  • In general you want to try and put things in onStart and onStop for logical start and stops.



  • Dagger inject self into graph
  • setContentView(
  • Butterknife.bind(this)
  • RxJava CompositeSubscription.add (if NON UI related work being done)
  • realm = Realm.getDefaultInstance();
soheilhy /
Last active September 24, 2023 18:00
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for,, and on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

johnmurrayvi / 51-android.rules
Last active November 26, 2021 14:41
Udev permission for android devices
View 51-android.rules
## Acer
#SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0600", OWNER="<username>"
#SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0600", OWNER="<username>"
## Dell
#SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0600", OWNER="<username>"
## Foxconn