Skip to content

Instantly share code, notes, and snippets.

@NikolaDespotoski
NikolaDespotoski / CursorCallback.java
Last active Mar 21, 2020
Cursor Diff Util callback.
View CursorCallback.java
import android.database.Cursor;
import android.support.annotation.Nullable;
import android.support.v7.util.DiffUtil;
/**
* Created by Nikola on 9/29/2016.
*/
public abstract class CursorCallback<C extends Cursor> extends DiffUtil.Callback {
private final C newCursor;
@kaushikgopal
kaushikgopal / android_lifecycle_recommendations.md
Last active Feb 2, 2022
Notes on opportune moments to do "stuff" in the Android Lifecycle
View android_lifecycle_recommendations.md
  • In general you want to try and put things in onStart and onStop for logical start and stops.

Activity

onCreate

  • Dagger inject self into graph
  • setContentView(R.layout.xxx)
  • Butterknife.bind(this)
  • RxJava CompositeSubscription.add (if NON UI related work being done)
  • realm = Realm.getDefaultInstance();
@soheilhy
soheilhy / nginxproxy.md
Last active Sep 28, 2022
How to proxy web apps using nginx?
View nginxproxy.md

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 example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

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

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