Skip to content

Instantly share code, notes, and snippets.

@bryanbraun
bryanbraun / store.js
Last active September 1, 2019 02:09
Alt React - Core files
export class Store {
constructor(initialState) {
this.events = {};
this.state = initialState || {};
}
/**
* setState works like a simplified version of lodash's _.set(),
* only it sets this.state instead of an arbitrary object.
*
@bryanbraun
bryanbraun / git-branching-diagram.md
Last active March 20, 2025 10:30
Example Git Branching Diagram

Example Git Branching Diagram

You can use this diagram as a template to create your own git branching diagrams. Here's how:

  1. Create a new diagram with diagrams.net (formerly draw.io)
  2. Go to File > Open From > URL
  3. Insert this url (it points to the xml data below): https://gist.githubusercontent.com/bryanbraun/8c93e154a93a08794291df1fcdce6918/raw/bf563eb36c3623bb9e7e1faae349c5da802f9fed/template-data.xml
  4. Customize as needed for your team.

@bryanbraun
bryanbraun / index.js
Created June 19, 2024 15:15
musicbox.fun console hack
// Run me in the developer console at https://musicbox.fun
let startTime = performance.now();
let wave = (x, elapsedTime) => (80 * Math.sin((x - (elapsedTime*4)) / 3));
function loop() {
let elapsedTimeSeconds = (performance.now() - (startTime / 10)) / 1000;
let waveVals = [];
for (let i=0; i < 15; i++) {
waveVals.push(wave(i, elapsedTimeSeconds) + 100);
}