Skip to content

Instantly share code, notes, and snippets.

@VincentMasselis
VincentMasselis / DateUtil.java
Last active May 31, 2021 09:49
Simple Java 7 RFC3339 parser (Android compatible)
/*
Inspired by http://cokere.com/RFC3339Date.txt
All rights deserve to Chad Okere
*/
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
@VincentMasselis
VincentMasselis / DateUtil.m
Last active January 17, 2017 13:44
Simple Objective-C RFC3339 parser
/*
Inspired by http://cokere.com/RFC3339Date.txt
All rights deserve to Chad Okere
*/
@implementation DateUtil
+ (NSDate *)parseRFC3339Date:(NSString *)date {
NSDate *parsedDate = nil;
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
@VincentMasselis
VincentMasselis / RxJavaInterop+kotlin.kt
Created January 17, 2017 13:43
RxJava2Interop + kotlin extensions
import hu.akarnokd.rxjava.interop.RxJavaInterop
// -----------------------------------------------------------------------------------------
// Conversions from 1.x to 2.x
// -----------------------------------------------------------------------------------------
fun <T> rx.Observable<T>.toV2Flowable(): io.reactivex.Flowable<T> = RxJavaInterop.toV2Flowable(this)
fun <T> rx.Observable<T>.toV2Observable(): io.reactivex.Observable<T> = RxJavaInterop.toV2Observable(this)