Skip to content

Instantly share code, notes, and snippets.

View jimbolla's full-sized avatar

Jim Bolla jimbolla

View GitHub Profile
@jimbolla
jimbolla / protectFromUnmount.js
Created November 16, 2015 19:38
protectFromUnmount
function protectFromUnmount() {
let callbacks = {};
let count = 0;
const noop = value => value;
const wrapCallback = id => function(...params) {
const raceSafeCallbacks = callbacks;
if (!raceSafeCallbacks)
@jimbolla
jimbolla / package.json
Last active April 27, 2016 15:11
React 15 - IE11 autofill bug demo
{
"name": "react-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
@jimbolla
jimbolla / withStore.js
Last active September 10, 2016 14:54
withStore
import hoistStatics from 'hoist-non-react-statics'
import invariant from 'invariant'
import { Component, PropTypes, createElement } from 'react'
export default function withStore(
{
getDisplayName = name => `WithStore(${name})`,
methodName = 'withStore',
storeKey = 'store',
withRef = false,
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
// ESLint
"dbaeumer.vscode-eslint",
// Flow Language Support
"flowtype.flow-for-vscode",
@jimbolla
jimbolla / AutoSubmitOnBlur.js
Created September 5, 2018 14:28
react-final-form auto submit on blur
import diff from "object-diff";
import React from "react";
import { FormSpy } from "react-final-form";
class AutoSubmitOnBlur extends React.Component {
state = {
active: null,
values: {}
};
@jimbolla
jimbolla / ResultAsJsonAttribute.cs
Created October 17, 2018 13:35
ResultAsJsonAttribute.cs
using System.Web.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Whatever
{
public class ResultAsJsonAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext context)
{
@jimbolla
jimbolla / cloudSettings
Last active October 22, 2018 02:45
Visual Studio Code Sync Settings GIST
{"lastUpload":"2018-10-22T02:45:49.253Z","extensionVersion":"v3.2.0"}
@jimbolla
jimbolla / cloudSettings
Last active July 10, 2019 20:44
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-07-10T20:44:56.020Z","extensionVersion":"v3.3.1"}
@jimbolla
jimbolla / machine.js
Created October 8, 2020 20:33
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@jimbolla
jimbolla / gist:d8e90d74b3c9178508e78bd331cd6b78
Created November 3, 2020 21:55
Factorio Mall Blueprint
0eNrcvdtyHDmyLfgvei6OBe5A29j8x9ixbWUpKiXxFG+TJKu697b+94kkJSYyIjx8LY+kZqpf9kXFdAAefgOwfOF/Pn2+fdk/Hm7unz/9438+3Vw/3D99+sf/+p9PTzff7ne3x397/tfj/tM/Pt087+8+/fbpfnd3/P++7p6er54Pu/unx4fD89Xn/e3zp3//9unm/sv+n5/+4f79myph9/S0v/t8e3P/7epud/395n5/FToR/t//9dun/f3zzfPN/m1Gr//Pv36/f7n7vD+MY7xLenp+GH/81+72dpT++PA0/uTh/jjuUYx3/0f67dO/xr8f/49/H+c1keNBOYMiJ4BygiIngnK8IieBcpIiJ4NyoiKngHKKIqeCcrIip4FymiLHDaCgqgkCLTpoFu1Akw6aSTvQpoNm0w406qAZtQOtOmhW7UCzDppZO9Cug2bXDjTsoBm2Ay07aJbtQcsOmmV70LKjGqtBy46aZXvQsqNm2R607KhZtgctO2qW7UHLjpple9Cyo2bZHrTsqFm2By07apYdQMuOmmUH0LKTZtkBtOykliGgZSfNsgNo2Umz7ABadtIsO4CWnTTLDqBlJ82yA2jZSbPsAFp20iw7gpadNMuOoGVnzbIjaNlZs+wIWnZWK2zQsrNm2fFk2d92z/slEWem+NunLzeH/fXbH/glgVkVmDiBoKVnzdJjVWeWuZmBFp81i0+gxWfN4hNo8UWz+ARafNEsPoEWXzSLT6DFF3VTCcbyosXyBMbyosXyBFp40Sw8gbG8aLE8gZZdNMvOoGUXzbIzaNlVs+wMWnbVLDuDll01y86gZVfNsjNo2VU9LwEtu2qWnUHLrpplZ9Cyq2bZGbTsqll2AS27apZdQMtummUX0LKbZtkFtOymWXYBLbtpll1Ay26aZRfQspt6FAhadtMMsqhVSStUVVKaKrBSAuugCmycQMziw6BZfPWgIM3iawAFaRZfIyhIs/iaQEGaxdcMCtIsvhZQkHr6XUFBmuvUBgrSYnkbQEF