Skip to content

Instantly share code, notes, and snippets.

Avatar

Johan Steenkamp jsteenkamp

View GitHub Profile
@jsteenkamp
jsteenkamp / webWorker.js
Created Oct 25, 2020 — forked from vitkon/webWorker.js
Long polling with web workers
View webWorker.js
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 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.
server.on('close',function(){
console.log('Server closed !');
});
View 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 Nov 11, 2018 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@jsteenkamp
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 (
<div>
<button onClick={() => this.setState({ showDialog: true })}>
Show Dialog
</button>
View angular-loadscript-with-documentwrite.js
/**
* 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 {
You can’t perform that action at this time.