Skip to content

Instantly share code, notes, and snippets.

@lenamuit
lenamuit / centos-nginx.sh
Last active August 29, 2015 14:26 — forked from dannguyen/centos-nginx.sh
This is a nginx initialization script for CentOS that slightly modifies this template from Slicehost to use nginx's default install paths: http://articles.slicehost.com/2009/2/2/centos-adding-an-nginx-init-script
#!/bin/sh
#
# used in https://gist.github.com/dannguyen/5415628 for CentOS
# modification of: http://articles.slicehost.com/2009/2/2/centos-adding-an-nginx-init-script
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;
@lenamuit
lenamuit / build.gradle
Last active August 29, 2015 14:06 — forked from jmpinit/build.gradle
Gradle file for OpenCv library
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android-library'
// Replace 'dependencies' in your build.gradle file with the following
// or add these to whatever other dependencies you have.
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile 'com.google.android.gms:play-services:3.1.36+'
compile('com.google.api-client:google-api-client:1.4.1-beta') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.http-client:google-http-client-gson:1.15.0-rc'