Skip to content

Instantly share code, notes, and snippets.


Aaron Brewer spaceribs

View GitHub Profile

I've been exploring combining the concept of "Behavior Trees" ( with RxJS, and this revealed to me a combiner that I don't think currently exists, so I wanted to discuss if that's the case and if I should put up a PR to add such a combiner.

The most basic behavior tree at minimum contains an AND (sequence) combiner and an OR (selector) combiner. AND combiners run their children in sequence, and stop running if there are any failures. An AND combiner is actually very easy to translate to RxJS, it's literally just a concat.

An OR combiner instead runs it's children until success, and only fails if all it's children fail to return success. This is actually very similar to onErrorResumeNext except for the following attributes:

  • When all selectors are exhausted, throw an error.
  • Stop executing when any observable completes.

The code for the combiner in typescript/rxjs is below:

spaceribs / index.html
Last active Jun 13, 2018
Object Literal versus Map Access ( #jsbench #jsperf
View index.html
<!DOCTYPE html>
<meta charset="utf-8"/>
<title>Object Literal versus Map Access</title>
<script src=""></script>
<script src="./suite.js"></script>
<h1>Open the console to view the results</h1>
spaceribs /
Created Sep 3, 2017
Get double-shift behavior in Atom
keyPressed = false;
atom.keymaps.addKeystrokeResolver ({event}) ->
if event.key == "Shift" && event.type == "keydown"
if keyPressed
keyPressed = false;
return 'shift-double';
keyPressed = true;

Keybase proof

I hereby claim:

  • I am spaceribs on github.
  • I am spaceribs ( on keybase.
  • I have a public key ASDM8NFEUk77TaXH8snYeam9yqWKueACekMWuf7BUEeqpAo

To claim this, I am signing this object:

View gist:f59c4cb096cad848474b
* @license
* lodash 3.10.0 (Custom Build) <>
* Build: `lodash modern -o ./lodash.js`
* Copyright 2012-2015 The Dojo Foundation <>
* Based on Underscore.js 1.8.3 <>
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <>
;(function() {
spaceribs / gist:7694120
Last active Mar 17, 2016
paper.js angular directive using $http.get You can use this via: <paper src="scripts/papers/test.js" width="600" height="600"></paper>
View gist:7694120
'use strict';
.directive('paper', ['$http', function ($http) {
return {
replace: true,
template: '<canvas></canvas>',
restrict: 'E',
link: function postLink(scope, element, attrs) {
You can’t perform that action at this time.