This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Observable<List<String>> paginatedThings(final Observable<Void> onNextObservable) { | |
return Observable.create(new Observable.OnSubscribe<List<String>>() { | |
@Override | |
public void call(final Subscriber<? super List<String>> subscriber) { | |
onNextObservable.subscribe(new Observer<Void>() { | |
int latestPage = -1; | |
@Override | |
public void onCompleted() { | |
subscriber.onCompleted(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:state_enabled="false" | |
android:color="@color/flat_disabled_text"/> | |
<item android:color="@color/flat_normal_text"/> | |
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func getQueryStringParameter(url: String, param: String) -> String? { | |
let url = NSURLComponents(string: url)! | |
return | |
(url.queryItems? as [NSURLQueryItem]) | |
.filter({ (item) in item.name == param }).first? | |
.value() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.rgba(@colour, @alpha) { | |
@alphaColour: hsla(hue(@colour), saturation(@colour), lightness(@colour), @alpha); | |
@ieAlphaColour: argb(@alphaColour); | |
background-color: @colour; // Fallback for older browsers | |
// IE hacks | |
zoom: 1; // hasLayout | |
background-color: transparent\9; | |
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=@{ieAlphaColour}, endColorstr=@{ieAlphaColour})"; // IE 8+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import csv | |
import sys | |
# read sample tuleap csv header to avoid some field changes | |
tuleapcsvfile = open('tuleap.csv', 'rb') | |
reader = csv.DictReader(tuleapcsvfile) | |
# open stdout for output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Blatantly stolen from ES6 specs. Kept here for reference. | |
// http://wiki.ecmascript.org/doku.php?id=harmony:egal | |
if(!Object.is) { | |
Object.defineProperty(Object, 'is', { | |
value: function(x, y) { | |
if (x === y) { | |
// 0 === -0, but they are not identical | |
return x !== 0 || 1 / x === 1 / y; |
NewerOlder