Skip to content

Instantly share code, notes, and snippets.

View ComputerCarl's full-sized avatar

Carl ComputerCarl

  • computercarl
  • North Cackalacky, USA
View GitHub Profile
const { Machine, interpret, assign } = require('xstate');
const firstService = () => new Promise(resolve => {
setTimeout(() => {
console.log('in first service');
resolve();
}, 3000);
})
const secondService = () => {
@ComputerCarl
ComputerCarl / App.js
Last active November 15, 2019 00:25
Universal Keycloak App React
import './App.css';
import React, { useEffect, useState } from 'react';
const loadScript = script => new Promise(resolve => {
const scriptTag = window.document.createElement('script');
scriptTag.src = script;
scriptTag.setAttribute('defer', 'defer');
scriptTag.setAttribute('crossorigin', 'crossorigin');
window.document.body.appendChild(scriptTag);
window.addEventListener('load', () => resolve());
@ComputerCarl
ComputerCarl / trending-deviation.js
Last active February 15, 2019 16:43
Z-score in node
@ComputerCarl
ComputerCarl / TextImporter.jsx
Created January 4, 2018 03:58
Import Text Into React
import React, { Component } from 'react';
class App extends Component {
componentWillMount () {
}
componentDidMount () {
const textFile = require('./text.md');
fetch(textFile)
.then(response => {
return response.text();