Skip to content

Instantly share code, notes, and snippets.

View torjusb's full-sized avatar
:shipit:
rusting away

Torjus Bjåen torjusb

:shipit:
rusting away
View GitHub Profile
const {useCallback, useEffect, useReducer, useRef} = require('react');
let effectCapture = null;
exports.useReducerWithEmitEffect = function(reducer, initialArg, init) {
let updateCounter = useRef(0);
let wrappedReducer = useCallback(function(oldWrappedState, action) {
effectCapture = [];
try {
let newState = reducer(oldWrappedState.state, action.action);
@justgage
justgage / HowToElm.md
Last active January 17, 2020 23:49
How To Elm

How to Elm

This is a basic guide on how to learn Elm rather than actually teach you. I'm going to mostly link to resources that I feel are valuable and try to "teach you how to fish".

The main purpose is to accelerate your learning and save you a lot of googling and weeding through bad explinations.

Essential links

@amoslanka
amoslanka / Berksfile
Last active September 9, 2016 19:59
StatsD/Graphite server on AWS/EC2 using Vagrant, Chef Solo, and Berkshelf
site :opscode
cookbook 'apt'
cookbook 'statsd', git: 'https://github.com/librato/statsd-cookbook.git'
cookbook 'graphite', git: 'https://github.com/hw-cookbooks/graphite.git'
@lukemorton
lukemorton / README.markdown
Created July 8, 2011 14:44
init.d file for statsd and carbon on rhel

Customised by Luke Morton

Ideally do this as SUDO

yum install -y git gcc gcc-c++ zlib-devel curl curl-devel openssl

Install node

wget http://nodejs.org/dist/node-v0.4.9.tar.gz
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}