Skip to content

Instantly share code, notes, and snippets.

View jsteenkamp's full-sized avatar

Johan Steenkamp jsteenkamp

View GitHub Profile
@jsteenkamp
jsteenkamp / webWorker.js
Created October 25, 2020 03:56 — forked from vitkon/webWorker.js
Long polling with web workers
function workerFunction() {
this.addEventListener('message', (e) => {
console.log('log2: ', e);
fetchUrl(e.data);
})
const fetchUrl = (url) => {
fetch(url)
.then((response) => {
console.log(response);
@jsteenkamp
jsteenkamp / net.js
Created November 19, 2018 21:42 — forked from sid24rane/net.js
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
var net = require('net');
// creates the server
var server = net.createServer();
//emitted when server closes ...not emitted until all connections closes.
server.on('close',function(){
console.log('Server closed !');
});
@jsteenkamp
jsteenkamp / App.js
Created November 12, 2018 02:39 — forked from ryanflorence/App.js
import React, { Suspense, useState } from "react";
import { unstable_createResource as createResource } from "react-cache";
import {
Combobox,
ComboboxInput,
ComboboxList,
ComboboxOption
} from "./Combobox2.js";
function App({ tabIndex, navigate }) {
@jsteenkamp
jsteenkamp / ladder.md
Created November 11, 2018 18:05 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@jsteenkamp
jsteenkamp / foo.js
Last active August 27, 2018 19:35 — forked from ryanflorence/foo.js
Animation/transition using react spring
// 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 (
<div>
<button onClick={() => this.setState({ showDialog: true })}>
Show Dialog
</button>
/**
* This module is a variant which supports document.write. If you need document.write use this instead
* Author: Deepak Subramanian @subudeepak(https://github.com/subudeepak)
* Distributed under MIT License
*/
/*global angular */
(function (ng) {
'use strict';
app.directive('script', function() {
return {