Skip to content

Instantly share code, notes, and snippets.

@mdrabic
mdrabic / keybase.md
Created January 2, 2018 13:24
keybase.md

Keybase proof

I hereby claim:

  • I am mdrabic on github.
  • I am mikedrabic (https://keybase.io/mikedrabic) on keybase.
  • I have a public key ASCFtkllKmnti-M7c7wlSvSiWnlT2upDTXRG6yh-TpkMDQo

To claim this, I am signing this object:

@mdrabic
mdrabic / tweet_dumper.py
Last active June 24, 2016 13:02 — forked from yanofsky/LICENSE
A script to download all of a user's tweets into a csv
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
access_secret = ""
@mdrabic
mdrabic / sample.java
Created June 24, 2014 22:38
rxjava worker thread example
final Scheduler.Worker worker = Schedulers.newThread().createWorker();
worker.schedule(new Action0() {
@Override
public void call() {
if (!mAnimationSet.isStarted()) {
removeViewAt(0);
worker.unsubscribe();
} else {
worker.schedule(this, 500, TimeUnit.MILLISECONDS);
}
@mdrabic
mdrabic / EntityLoader.java
Created November 27, 2013 01:06
An abstract generic loader that can be used to fetch data from a sqlite database. It handles the database connection and delivering of results to any class that implements LoaderCallbacks. It is up to the child class to implement doInBackground(...) thus allowing the child to decide what data to load. This class does have a dependency to the Gre…
package com.mdrabic.content;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.support.v4.content.AsyncTaskLoader;
import com.docdock.android.R;
import com.docdock.android.db.DaoMaster;
import com.docdock.android.db.DaoSession;
@mdrabic
mdrabic / build.gradle
Last active December 29, 2015 01:09
build.gradle template
apply plugin: 'com.android.application'
// Manifest version information!
def versionMajor = 1
def versionMinor = 0
def versionPatch = 0
def versionBuild = 0 // bump for dogfood builds, public betas, etc.
def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
def buildTime = new Date().format("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC"))
@mdrabic
mdrabic / Mail.java
Created November 5, 2013 02:25
The Bundle holds Key<String> Value<Parcelable> pairs and provides convenience methods for several of the primitive wrapper types such as Short, Byte, Integer, etc. In the event your data does not easily fit into one of these methods, you can implement the Parcelable interface and use Bundle.putParcelable(key,value).
import android.os.Parcel;
import android.os.Parcelable;
import java.util.ArrayList;
import java.util.List;
/**
* POJO to hold contents of a Mail. Implements Parcelable so that it can be used in the bundle to
* save and restore information to the UI entered by the user in a Activity.
*/