Skip to content

Instantly share code, notes, and snippets.

View abersnaze's full-sized avatar

George Campbell abersnaze

View GitHub Profile
@abersnaze
abersnaze / SessionManager.java
Last active April 29, 2016 20:23
A Session Manager Class.
import java.util.function.Function;
import rx.Completable;
import rx.Observable;
import rx.functions.Func1;
public class Session<T> {
public static interface CheckedFunc0<R> {
public R call() throws Exception;
}
package rx.schedulers;
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.Scheduler;
import rx.Subscription;
import rx.functions.Action0;
import rx.functions.Func0;
import rx.functions.Func1;
package rx.schedulers;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import rx.Observable;
import rx.Scheduler;
import rx.Subscription;
import rx.functions.Action0;
import rx.functions.Func0;
@abersnaze
abersnaze / Main.java
Created December 7, 2016 00:24
Using Guice to as a stack language to compile a tree structure.
import java.util.List;
import java.util.Stack;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;
import com.google.inject.Binder;
import com.google.inject.Binding;
import com.google.inject.Guice;
import com.google.inject.Inject;
@abersnaze
abersnaze / Main.java
Created March 11, 2017 14:31
RxJava expand
package foo;
import static rx.Observable.concat;
import static rx.Observable.empty;
import static rx.Observable.range;
import java.util.concurrent.atomic.AtomicLong;
import rx.Observable;
import rx.Observer;
@abersnaze
abersnaze / InlineInlineMonacoEditor.stories.tsx
Last active September 17, 2020 12:21
React component, in typescript, wrapping Monaco editor to automatically grow & shrink with content to avoid scroll.
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import InlineMonacoEditor from './InlineMonacoEditor';
export const LINES = [
'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
'Aenean aliquet, nulla eget auctor porttitor, lacus urna',
'posuere purus, at suscipit orci sapien quis est. Curabitur',
@abersnaze
abersnaze / machine.js
Last active December 21, 2019 16:41
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)

Keybase proof

I hereby claim:

  • I am abersnaze on github.
  • I am abersnaze (https://keybase.io/abersnaze) on keybase.
  • I have a public key ASBmE0nDLhYFJkOZdubwyR_mIrRQPPE6w98JrRs_jx3Uswo

To claim this, I am signing this object: