Skip to content

Instantly share code, notes, and snippets.

@patrickhammond
patrickhammond / cleanupInteliJFiles.sh
Created August 6, 2014 17:37
Remove all IntelliJ/Android Studio project files
#!/bin/sh
find . -name *.iml -print0 | xargs -0 rm
rm -rf .idea/
@benjchristensen
benjchristensen / EventBus.java
Last active December 23, 2025 06:55
EventBus.java
import rx.Observable;
import rx.subjects.PublishSubject;
import rx.subjects.SerializedSubject;
import rx.subjects.Subject;
/**
* Simple pass-thru event bus with error handling and reconnect.
*/
public class EventBus {
@billmote
billmote / LearningApplication.java
Created July 28, 2014 19:18
Force StrictMode for developer builds without requiring tweaking of the phone/emulator settings.
/**
* Created by Bill on 7/28/14.
*/
public class LearningApplication extends Application {
private static final String TAG = QuickeyLearningApplication.class.getSimpleName();
@Override
public void onCreate() {
super.onCreate();
@staltz
staltz / introrx.md
Last active July 24, 2026 00:55
The introduction to Reactive Programming you've been missing
@archeg
archeg / gist:8333021
Created January 9, 2014 11:58
Example of code that uses HID for Android to connect to the device through USB.
package com.company.app.PlatformMethods;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Set;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
@kevinmrohr
kevinmrohr / StateManager
Last active December 25, 2015 21:48
Utility class to standardize pulling state off a Bundle, Intent, or data source in Android apps. Also provides timeout functionality for if the data has expired.
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import org.joda.time.DateTime;
import java.io.Serializable;
import static org.joda.time.DateTime.now;
/**
@mheadd
mheadd / dartfirststate_de_us.sql
Created October 7, 2010 17:13
A SQL script for importing GFTS data from the State of Delaware into a MySQL database.
-- -------------------------------------------------------------------------------------------------------
-- A SQL script for importing GFTS data from the State of Delaware into a MySQL database.
--
-- Copyright 2010 Mark J. Headd
-- http://www.voiceingov.org
--
-- This file is free software; you can redistribute it and/or modify it under the terms of the
-- GNU Library General Public License as published by the Free Software Foundation; either version 2 of the
-- License, or (at your option) any later version.
-- This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;