Skip to content

Instantly share code, notes, and snippets.

View jbripley's full-sized avatar

Joakim Bodin jbripley

View GitHub Profile
@mttkay
mttkay / Pager.java
Created November 4, 2015 15:46
A simple Rx based pager
public class Pager<I, O> {
private static final Observable FINISH_SEQUENCE = Observable.never();
private PublishSubject<Observable<I>> pages;
private Observable<I> nextPage = finish();
private Subscription subscription = Subscriptions.empty();
private final PagingFunction<I> pagingFunction;
private final Func1<I, O> pageTransformer;
// Source for the Accidental Tech Podcast (ATP) T-Shirt:
// http://www.marco.org/2014/04/29/atp-shirts
//
// By Troy Gaul, June 2, 2014.
//
// Based on Obj-C veresion by Marco Arment, April 28, 2014. MIT license.
// https://gist.github.com/marcoarment/2542cd28cb5df0aa97d8
import UIKit
@lenary
lenary / 00-intro.md
Last active August 29, 2015 13:56
Guidance Notes for CRDT Performance Issues

I've had one question about subpar performance in Riak 2.0's CRDTs. I thought I'd write this so that people can more easily diagnose these issues, without the CRDT team having to step in every time.

An Example: A Client was having problems with the performance fetching and updating sets. The issue manifested itself with poor fetch performance.

So, how do you go about debugging/diagnosing this?

@jhartikainen
jhartikainen / scrape.py
Created October 6, 2011 20:43
Very quick Battlelog soldier statistics scraper
#
# This script scrapes your soldier statistics from Battlelog
# NOTE: This is just a very quick demonstration, it doesn't really do much as-is, besides
# authenticate to Battlelog and get you a dict of your soldier's statistics.
# There is no error handling, no anything. It will only work if everything goes well.
#
#
# Input your Origin username and password into the params dict below and it should work.
#
# In the very bottom, the stats dict will contain the data from the Battlelog JSON response.