Skip to content

Instantly share code, notes, and snippets.

View michaeljacobdavis's full-sized avatar

Mike Davis michaeljacobdavis

View GitHub Profile
@developit
developit / *object-diff-patch.md
Last active August 20, 2021 15:03
Compute an object diff, then apply it as a patch to an existing object. https://npm.im/object-diff-patch

object-diff-patch

// on the main thread
import { apply } from 'object-diff-patch/apply';

import createWorker from 'workerize-loader!./worker.js';
const worker = createWorker();

const CACHE = new Map();
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active November 3, 2024 17:14
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@davejhilton
davejhilton / tag_values.grammar
Created October 1, 2016 16:12
Jison Grammar for grafana kairosdb-datasource queries
/*
The grammar below is intended for use with Jison Parser Generator (http://zaa.ch/jison/)
Paste the contents below int http://zaa.ch/jison/try/ to see it in action
*/
/* ====== START GRAMMAR ====== */
/* description: Parses kairosdb-datasource 'tag_values' queries */
/* lexical grammar */
%lex
%%
@joshdover
joshdover / README.md
Last active September 28, 2023 21:38
Idiomatic React Testing Patterns

Idiomatic React Testing Patterns

Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.

Setup

I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a beforeEach. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern that gives great defaults for each test example but allows every example to override props when needed:

@megamaddu
megamaddu / vim.md
Last active August 29, 2015 14:26
@karlwestin
karlwestin / errorhandler.js
Created July 31, 2014 09:22
simple window.onerror handler
function errorHandler(msg, url, line, column, err) {
// firefox bug to watch for 5 arg error handler
// https://bugzilla.mozilla.org/show_bug.cgi?id=630464
/*
* most browsers don't give column number,
* but chrome can do it sometimes
*/
if(typeof column == "object") {
err = column;
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik