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 / README.md
Last active April 15, 2019 22:05
WhatsApp Example Image

...

@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 / 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 / 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 / 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',