Skip to content

Instantly share code, notes, and snippets.

View dkundel's full-sized avatar
🐼
Panda hacking JavaScript

Dominik Kundel dkundel

🐼
Panda hacking JavaScript
View GitHub Profile
@dkundel
dkundel / machine.js
Last active September 3, 2020 16:19
Generated by XState Viz: https://xstate.js.org/viz
const ModeEvents = {
showWelcome: 'SHOW_WELCOME',
showClosedCaptioning: 'SHOW_CLOSED_CAPTIONING',
showResources: 'SHOW_RESOURCES',
showSchedule: 'SHOW_SCHEDULE',
showInstaller: 'SHOW_INSTALLER',
showCheatMode: 'SHOW_CHEAT_MODE',
showTest: 'SHOW_TEST',
showDemos: 'SHOW_DEMOS',
@dkundel
dkundel / machine.js
Created September 2, 2020 18:36
Generated by XState Viz: https://xstate.js.org/viz
function assignResult(name) {
return assign({
results: (context, event) => {
console.log(event);
return { ...context.results, [name]: event.data };
},
});
}
const log = (context, event) => {
@dkundel
dkundel / App.jsx
Created August 21, 2020 00:38
Calculator Remote Participants
const React = require('react');
const { useState, useEffect, useReducer } = require('react');
const { render, Box, Text, useInput, useApp, useFocus } = require('ink');
const useStdoutDimensions = require('ink-use-stdout-dimensions');
const Key = ({ children, onSelect }) => {
const { isFocused } = useFocus();
useInput((input, key) => {
if (key.return && isFocused) {
onSelect();
@dkundel
dkundel / examples.ts
Created June 13, 2019 19:29
Examples from AngularSF TypeScript talk
/** Types vs Interfaces */
type Configuration = {
baseUrl: string;
ttl: number;
};
type ConfigWithCredentials = Configuration & {
credentials: {
username: string;
@dkundel
dkundel / README.md
Last active April 15, 2019 22:05
WhatsApp Example Image

...

@dkundel
dkundel / README.md
Created October 25, 2018 18:32
Demo Style Loader

It works

@dkundel
dkundel / client.ts
Last active December 8, 2017 00:18
Twilio Video TS
import { connect } from 'twilio-video';
const TOKEN_URL = 'THE_URL_TO_YOUR_FUNCTION';
const roomName = 'myroom';
let connected = false;
let localMediaEl = document.getElementById('localMedia');
let remoteMediaEl = document.getElementById('remoteMedia');
let buttonConnectEl = document.getElementById('buttonConnect');
type Safe<T> = { [P in keyof T]: string };
function getSafeEnvironment<T extends {}>(e: T): Safe<T> {
return new Proxy(e, {
get: function(env: any, key: string): string {
const value: any = env[key];
if (value == null) {
throw new Error("'" + key + "' environment variable is not set.");
}
return value;
@dkundel
dkundel / bash.bas
Created August 30, 2017 08:16 — forked from sagnew/bash.bas
$BASH 2017 Apple IIe BASIC game
10 REM Clear the screen
20 TEXT : HOME
25 REM DISPLAY WELCOME SCREEN
30 VTAB 4: HTAB 15: PRINT "$BASH RACER"
40 VTAB 13: HTAB 3: PRINT "USE LEFT AND RIGHT ARROW KEYS TO MOVE"
50 VTAB 14: HTAB 7: PRINT "ANY OTHER KEY GOES STRAIGHT"
60 VTAB 21: PRINT "PRESS ANY KEY TO PLAY"
65 VTAB 23: PRINT "SCORE 5000 POINTS TO WIN"
70 REM WAIT FOR KEYPRESS
80 GET KEY$
@dkundel
dkundel / keybase.md
Created August 22, 2017 19:35
keybase.md

Keybase proof

I hereby claim:

  • I am dkundel on github.
  • I am dkundel (https://keybase.io/dkundel) on keybase.
  • I have a public key ASBVtUGttt-FlmMolkfj57F1etkXu76KDpS6O1twC7u1rAo

To claim this, I am signing this object: