Skip to content

Instantly share code, notes, and snippets.

package com.sandbox
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.platform.setContent
private _applyChanges(changes: IterableChanges<T>) {
let singleAddIndex: number|undefined = undefined;
let singleRemoveIndex: number|undefined = undefined;
let hasMultipleMutations: boolean = false;
let singleMutatedItem: T|undefined = undefined;
changes.forEachOperation((item: IterableChangeRecord<any>, adjustedPreviousIndex: number | null, currentIndex: number | null) => {
if (! hasMultipleMutations) {
if (adjustedPreviousIndex === null && currentIndex !== null) {
if (! singleAddIndex) {
@okhobb
okhobb / gist:a58bf9f38bdb81c62137e0ada316aad9
Last active September 3, 2017 19:46
Example of creating a 'sync' loop from async work
let Promise = require('es6-promise').Promise;
function iterateStreamAsync(nextOpFn) {
function loop(prior) {
if (! prior) {
return;
}
return prior.then(() => loop(nextOpFn()));
}
return loop(nextOpFn());
@okhobb
okhobb / ehcache-ssl-rmi-diff
Created March 18, 2017 20:45
Diff relative to ehcache 2.10.3 to afford RMI via SSL sockets.
Index: ehcache-core/src/main/java/net/sf/ehcache/distribution/ConfigurableRMIClientSocketFactory.java
===================================================================
--- ehcache-core/src/main/java/net/sf/ehcache/distribution/ConfigurableRMIClientSocketFactory.java (revision 10517)
+++ ehcache-core/src/main/java/net/sf/ehcache/distribution/ConfigurableRMIClientSocketFactory.java (working copy)
@@ -101,22 +101,12 @@
}
/**
- * Return the JVM-level configured {@code RMISocketFactory}.
- * <p>