Skip to content

Instantly share code, notes, and snippets.

View rowlandekemezie's full-sized avatar
🏠
Working from home

Rowland I. Ekemezie rowlandekemezie

🏠
Working from home
View GitHub Profile
@rowlandekemezie
rowlandekemezie / app.js
Created October 23, 2017 11:44 — forked from acdlite/app.js
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
@rowlandekemezie
rowlandekemezie / 0Option2ConstructorSummary.md
Created November 29, 2016 12:20 — forked from allenwb/0Option2ConstructorSummary.md
New ES6 constructor features and semantics: Alternative 2 manual super in derived classes

New ES6 Constructor Semantics and Usage Examples

Manual super: Alternative Design where subclass constructors do not automatically call superclass constructors

This Gist presents a new design of class-based object construction in ES6 that does not require use of the two-phase @@create protocol.

One of the characteristics of this proposal is that subclass constructors must explicitly super invoke their superclass's constructor if they wish to use the base class' object allocation and initialization logic.

An alternative version of this design automatically invokes the base constructor in most situations.

@rowlandekemezie
rowlandekemezie / benchmark.sh
Created October 23, 2016 21:19 — forked from peterjmit/benchmark.sh
Bash Benchmark Script (using time)
#!/bin/bash
# REQUIRES SUDO
# Benchmark runner
repeats=20
output_file='benchmark_results.csv'
command_to_run='echo 1'
run_tests() {
# --------------------------------------------------------------------------
@rowlandekemezie
rowlandekemezie / introrx.md
Created September 24, 2016 20:25 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing