Skip to content

Instantly share code, notes, and snippets.

View jameslaneconkling's full-sized avatar

James Conkling jameslaneconkling

View GitHub Profile
@jameslaneconkling
jameslaneconkling / tree-recursion.js
Created March 19, 2018 15:22
Tail Recursive Tree Recursion
const reduceChildren = ([first, ...rest], accumulator, project, reducer) => (
rest.length === 0 ?
recurseTree(first, accumulator, project, reducer) :
reduceChildren(
rest,
recurseTree(first, accumulator, project, reducer),
project,
reducer
)
);
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
@jameslaneconkling
jameslaneconkling / subscribableOrPromise.ts
Created March 13, 2020 21:03
implement both the observable and promise spec
import { Subscribable, PartialObserver, Unsubscribable, Observable } from 'rxjs'
const noop = () => {}
// how to make this generic for all observables?
export class SubscribableOrPromise<T> implements PromiseLike<T>, Subscribable<T> {
observableOrPromise: Observable<T> | Promise<T>
@jameslaneconkling
jameslaneconkling / tech-onboarding.md
Last active October 17, 2022 20:01
Application Team Member Onboarding
  • grant access to platforms
    • Github
      • add to Sayari Org
      • add to appropriate teams
      • github project board walkthrough, Sayari's git-flow-lite processes
    • Google Cloud Platform
      • add to Sayari Datastore
      • GKE walkthrough
    • Sentry
  • ElasticCloud
@jameslaneconkling
jameslaneconkling / postgres_jsonb_perf.sql
Created February 10, 2025 01:49
Postgres JSONB and Composite Type property access performance
-------------------------------------------------------
-- create small object and measure time to access a key
-------------------------------------------------------
CREATE TABLE small_object AS (
SELECT jsonb_object_agg(n, 'abc') AS obj FROM generate_series(1,10) n
);
SELECT small_object.obj->'10' FROM small_object;
-- Time: 0.996 ms