Skip to content

Instantly share code, notes, and snippets.

View zebulonj's full-sized avatar

Zebulon Young zebulonj

View GitHub Profile
@zebulonj
zebulonj / rollup.config.js
Last active February 14, 2018 05:11
Canonical Rollup Configuration
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import uglify from 'rollup-plugin-uglify';
import pkg from './package.json';
export default [{
input : './index.js',
output: [
@zebulonj
zebulonj / spec.js
Last active February 5, 2018 16:54
Clean specs based on iteration inspector.
import test from 'tape';
import { query } from './store';
import { summarize } from './model';
// This could be removed to a helper library... you'd never have to look at it if you didn't want.
const inspectIteration = assert => steps => iterator => {
let result;
steps.forEach( ( def, index ) => {
const step = iterator.next( result );
@zebulonj
zebulonj / spec.js
Created February 3, 2018 08:20
Async/Await with Generators... the ultimate in decoupling!
import test from 'tape';
const query = async () => ({ value: 'Z' });
const call = ( fn, ...params ) => ({ fn, params });
const create = function *( formId ) {
const form = yield call( query, 'SELECT', formId );
return form;
@zebulonj
zebulonj / .npmrc
Last active March 20, 2023 04:33
Dockerfile with Private npm Module Dependencies
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
save-exact=true
loglevel=error

Keybase proof

I hereby claim:

  • I am zebulonj on github.
  • I am zebulonj (https://keybase.io/zebulonj) on keybase.
  • I have a public key whose fingerprint is 7156 A972 402B A62B 6392 270A 69F7 B512 2DD2 931A

To claim this, I am signing this object:

@zebulonj
zebulonj / component.jsx
Created August 24, 2015 19:55
React Component Pattern
export default function ({ React }) {
// Component
return function SearchBox( props ) {
return {
props,
render() {
const { label, actions } = this.props;
@zebulonj
zebulonj / rxjs-chain-filters.js
Last active May 31, 2018 00:32
Dynamically Chain a Sequence of Filters
import Rx from 'rx/dist/rx.all';
/**
* Filters accept an input, and return an observable that will yield a single value (the filtered input).
*
* @param x
* @returns {Observable<T>}
*/
function f1( x ) {
return Rx.Observable.create( function( observer ) {
@zebulonj
zebulonj / flux-react-animation.js
Last active August 29, 2015 14:23
Flux + React Animation: Academic to Implementation
'use strict';
/**
* Convenience method to get current time.
*
* @returns {Integer} Current time in milliseconds since Epoch.
*/
function now() {
return ( new Date() ).getTime();
}