Skip to content

Instantly share code, notes, and snippets.

View vuhrmeister's full-sized avatar

Valentin Uhrmeister vuhrmeister

View GitHub Profile
@vuhrmeister
vuhrmeister / machine.js
Created December 21, 2020 10:14
Generated by XState Viz: https://xstate.js.org/viz
const companyMachine = Machine({
id: 'company',
initial: 'tentative',
context: {
hasActiveContract: true,
minUntilDate: new Date('2020-12-31')
},
states: {
tentative: {
always: 'sales', // TODO for now
@vuhrmeister
vuhrmeister / machine.js
Last active April 16, 2020 12:47
Generated by XState Viz: https://xstate.js.org/viz
const channelMachine = Machine({
initial: 'joining',
states: {
joining: {
},
joined: {
on: {
// Error thrown: TypeError: Cannot read property 'target' of null
@vuhrmeister
vuhrmeister / machine.js
Created September 3, 2019 14:43
Generated by XState Viz: https://xstate.js.org/viz
const fetchRoute = () => {
return new Promise((resolve, reject) => {
resolve({
stops: [{ id: 1 }, { id: 2 }]
})
})
}
const stopMachine = Machine({
id: 'stop',
@vuhrmeister
vuhrmeister / machine.js
Last active August 30, 2019 12:55
Generated by XState Viz: https://xstate.js.org/viz
const appMachine = Machine({
id: 'app',
type: 'parallel',
context: {
setupDone: true // TODO must be false, true for now to skip setup
},
states: {
update: {
initial: 'idle',
states: {
@vuhrmeister
vuhrmeister / machine.js
Last active August 16, 2019 06:21
Generated by XState Viz: https://xstate.js.org/viz
const stopMachine = Machine({
id: 'stop',
initial: 'idle',
context: {
id: undefined
},
states: {
idle: {
on: {
START: 'pending',
class SassCompiler extends MultiFileCachingCompiler {
// That's a method to override from Meteor
// see: https://github.com/meteor/meteor/blob/devel/packages/caching-compiler/multi-file-caching-compiler.js#L57
// Meteor has a build system with caching files.
// Meteor will find all relevant files with given extension and call this method on each of them
// passing the processed file and all other files that matches the extension.
compileOneFile(inputFile, allFiles) {
let matchHistory = [];
let prevMatch = '';
.dumb {
font-size: 1.2em;
color: white;
background: #3A44BE;
padding: .1em 0;
box-shadow: 10px 0 #3A44BE,-10px 0 #3A44BE,10px 5px #FFE000,-10px 5px #FFE000;
}
body {
font-family: Arial;