Skip to content

Instantly share code, notes, and snippets.

View tprochazka's full-sized avatar

Tomáš Procházka tprochazka

View GitHub Profile
@tprochazka
tprochazka / 0_reuse_code.js
Created February 22, 2014 08:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tprochazka
tprochazka / ContractFragment.java
Created May 7, 2012 04:17 — forked from JakeWharton/ContractFragment.java
Base fragment to ensure the parent activity implements a contract interface.
/* Base fragment to ensure the parent activity implements a contract interface. */
public abstract class ContractFragment<T> extends Fragment {
private T mContract;
@Override
public void onAttach(Activity activity) {
try {
mContract = (T)activity;
} catch (ClassCastException e) {
throw new IllegalStateException(activity.getClass().getSimpleName()