Skip to content

Instantly share code, notes, and snippets.

View geophree's full-sized avatar

Jeff Hanke geophree

View GitHub Profile
@geophree
geophree / index.js
Created April 27, 2020 19:48
Crank.js TodoMVC alternative events/handlers implementation
// based on https://codesandbox.io/s/crank-todomvc-k6s0x
// try it at https://codesandbox.io/s/crank-todomvc-alternative-jluse
/** @jsx createElement */
// @bikeshaving/crank 0.1.1
// todomvc-app-css 2.2.0
// todomvc-common 1.0.5
import { createElement, Fragment } from "@bikeshaving/crank";
import { renderer } from "@bikeshaving/crank/dom";
@geophree
geophree / install.py
Last active June 14, 2018 16:42
Build Graveyard Keeper directory structure from installer on linux
#!/usr/bin/env python3
# Big thanks to @TechnicianLP for the inspiration! See https://gist.github.com/TechnicianLP/5882de4075b6ed3700bba2bbc310e616
# This script builds the Graveyard Keeper directory/file tree using the .msi installer db.
# NOTE: Before running this script:
# Install wine (GK works for me with 3.9, probably needs at least 3.0)
# unzip the installer, then run:
# wine installer_filename.exe /extract
@geophree
geophree / Loading.js
Created August 22, 2016 18:17
Universal redux-saga loading module WIP
import R from 'ramda';
export const LOADING_START = 'app-resource/loading/LOADING_START';
export const LOADING_DONE = 'app-resource/loading/LOADING_DONE';
export const LOADING_ERROR = 'app-resource/loading/LOADING_ERROR';
const defaultState = Object.freeze({
loading: [],
error: [],
});
@geophree
geophree / redux-saga-server-side-render.js
Last active August 22, 2016 18:08
Universal redux-saga server-side render
import R from 'ramda';
import ReactDOMServer from 'react-dom/server';
import { put, call } from 'redux-saga/effects';
const LOADING = 'LOADING';
const MAX_RENDERS = 10;
export function renderUntilDone(store, app) {
return new Promise((resolve, reject) => {
let again = true;