Skip to content

Instantly share code, notes, and snippets.

View skykelsey's full-sized avatar

Sky Kelsey skykelsey

View GitHub Profile
@skykelsey
skykelsey / FlushableBufferTransformer.kt
Created June 6, 2019 20:11
An ObservableTransformer for adding flushable buffering to an Observable.
package com.example
import io.reactivex.Observable
import io.reactivex.ObservableSource
import io.reactivex.ObservableTransformer
import io.reactivex.Scheduler
import java.util.concurrent.TimeUnit
class FlushableBufferTransformer<T>(
val flusher: Observable<Unit>,
return connection!!
.subscribeOn(Schedulers.io())
.flatMap {
Observable.defer {
val successValue = AtomicReference<ByteArray>()
it.readCharacteristic("0222828d-1d28-4f2c-82e7-2e8f8740d29d")
.doOnSuccess {
successValue.lazySet(it)
}
.repeatWhen { flowable ->
Privacy Policy
Sky Kelsey built the Soundcolor app as a Free app. This SERVICE is provided by Sky Kelsey at no cost and is intended for use as is.
This page is used to inform website visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Soundcolor unless otherwise defined in this Privacy Policy.
Skys-MacBook-Pro:java sky$ javac ShelfProbability.java
Skys-MacBook-Pro:java sky$ java ShelfProbability 10000000
Finished in 2.31 seconds
--------------------------------
Iterations: 10,000,000
Green Bottoms: 5,001,852
GreenTops: 3,334,291
Green Top Probability: 0.6666%
@skykelsey
skykelsey / Apptentive Android Studio Instructions
Last active December 29, 2015 18:39
Instructions for integrating Apptentive into an Android Studio project using Gradle.
1. Import the existing Apptentive Android SDK module into your project.
2. Add the android-Gradle facet to the apptentive-android-sdk module (in the module settings).
3. Add a build.gradle file listed below to apptentive-android-sdk/
4. In your main module's build.gradle file, add a reference to the Apptentive Android SDK :
dependencies {
compile project(":apptentive-android-sdk")
}
5. In your settings.gradle file, add an include for apptentive-android-sdk:
include ':apptentive-android-sdk', ':your-module'