Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Drabic mdrabic

  • Levvel
  • Charlotte, NC
View GitHub Profile
@mdrabic
mdrabic / Mail.java
Created Nov 5, 2013
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).
View Mail.java
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.
*/
@mdrabic
mdrabic / build.gradle
Last active Dec 29, 2015
build.gradle template
View build.gradle
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 / EntityLoader.java
Created Nov 27, 2013
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…
View EntityLoader.java
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 / tweet_dumper.py
Last active Jun 24, 2016 — forked from yanofsky/tweet_dumper.py
A script to download all of a user's tweets into a csv
View tweet_dumper.py
#!/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 Jun 24, 2014
rxjava worker thread example
View sample.java
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);
}
View 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: