Skip to content

Instantly share code, notes, and snippets.

Johan Steenkamp jsteenkamp

Block or report user

Report or block jsteenkamp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jsteenkamp / net.js
Created Nov 19, 2018 — forked from sid24rane/net.js
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
View net.js
var net = require('net');
// creates the server
var server = net.createServer();
//emitted when server closes ...not emitted until all connections closes.
console.log('Server closed !');
View App.js
import React, { Suspense, useState } from "react";
import { unstable_createResource as createResource } from "react-cache";
import {
} from "./Combobox2.js";
function App({ tabIndex, navigate }) {
jsteenkamp /
Created Nov 11, 2018 — forked from jamtur01/
Kickstarter Engineering Ladder
jsteenkamp /
Created Sep 4, 2018
Simple queue using async/await

Queue using async/await

Implement a queue using async/await.

I created a single instance, easy enough to convert to a factory if you want multiple queues or add features like timeout with configuration object.

Although this solution is simple and does not require any additional libraries I do not think it is robust. For example retries after errors or timeouts is not supported. Rather than solve these issues it makes more sense to look at proven solutions such as message/task queues.


jsteenkamp / foo.js
Last active Aug 27, 2018 — forked from ryanflorence/foo.js
Animation/transition using react spring
View foo.js
// Adds a lovely fade in of the modal
// and a gentle slide-down of the modal content
class Demo extends React.Component {
state = { showDialog: false };
render() {
return (
<button onClick={() => this.setState({ showDialog: true })}>
Show Dialog
jsteenkamp / elevations.js
Created Jun 22, 2018
Google Material Design Elevations
View elevations.js
// Google Material Design 1-24dp elevations (shadows)
const umbraOpacity = '0.2';
const penumbraOpacity = '0.14';
const ambientOpacity = '0.12';
// map index are [0-24]
const elevationUmbraMap = [
jsteenkamp / index.js
Created Jun 14, 2016
React Stand Alone component with config
View index.js
// only entry point for CSS processed via webpack
import '../styles/main.scss';
import React from 'react';
import { render } from 'react-dom';
import { browserHistory } from 'react-router';
import configureStore from './store';
import root, { Root } from './root';
const store = configureStore(root.rootInitialState);
jsteenkamp / readFromAmazonS3.cfm
Last active May 27, 2016
Replacement for ColdFusion <cffile.../> to upload and read (acl = public-read) to/from Amazon S3
View readFromAmazonS3.cfm
<cffunction name="readFromAmazonS3">
<cfargument name="fileName" required="true"/>
<cfargument name="bucket" default="mybucket"/>
<cfhttp method="GET" url="" timeout="300" result="result"></cfhttp>
<cfreturn result.filecontent/>
jsteenkamp / todo.js
Last active Mar 11, 2016
Commented EggHead Redux Example
View todo.js
// Reducers are prue functions that implement the update logic of the applications
// Reducers define how to calculate the next State from the current State and the dispatched Action
// Reducer function returns the current State if not Action is performed.
// Redux passes the new State to each component and React re-renders them.
// Reducers are typically called by Container components. Container components do not emit DOM (so they
// do not have any associated CSS)
const todo = (state, action) => {
switch (action.type) {
case 'ADD_TODO':
You can’t perform that action at this time.