This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true | |
do | |
clear | |
ls -lhrt ~/Library/iTunes/iPhone\ Software\ Updates | |
sleep 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const childMachine = Machine({ | |
id: 'child', | |
initial: 'step1', | |
states: { | |
step1: { | |
on: { STEP: 'step2' }, | |
}, | |
step2: { | |
on: { STEP: 'step3' }, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const echoCallbackHandler = (context, event) => (callback, onEvent) => { | |
onEvent(e => { | |
if (e.type === 'HEAR') { | |
callback('ECHO') | |
} | |
}) | |
} | |
const echoMachine = Machine({ | |
id: 'echo', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetchAnimals = ()=>{ | |
return fetch('https://www.reddit.com/r/aww.json') | |
.then(res => res.json()) | |
.then(data => data.data.children.map(child => child.data)) | |
} | |
const cuteAnimals = Machine({ | |
id:'cuteAnimals', | |
initial:'idle', | |
context:{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const lightMachine = Machine({ | |
id:'trafficLight', | |
initial:'red', | |
context:{ | |
rushHourMultiplier:1 | |
}, | |
on:{ | |
INC_RUSH_HOUR:{ | |
actions:['incRushHour'] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tryAgainMachine = Machine({ | |
id:'tryTryagain', | |
initial:'idle', | |
context:{ | |
tries:0 | |
}, | |
states:{ | |
idle:{ | |
on:{ TRY:'trying'} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const spaceHeaterMachine = Machine({ | |
id: 'spaceHeater', | |
initial: 'poweredOff', | |
states: { | |
poweredOff: { | |
on: { TOGGLE_POWER: 'poweredOn.hist' } | |
}, | |
poweredOn: { | |
on: { TOGGLE_POWER: 'poweredOff' }, | |
type:'parallel', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const spaceHeader = Machine({ | |
id:'spaceHeader', | |
initial:'poweredOff', | |
states:{ | |
poweredOff:{ | |
on:{ | |
TOOGLE_POWER:'poweredOn' | |
} | |
}, | |
poweredOn:{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const doorMachine = Machine({ | |
id:'door', | |
initial:'locked', | |
states:{ | |
locked:{ | |
id:'locked', | |
on:{ | |
unlocked:'unlocked' | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const VendingMachine = Machine({ | |
id:'vendingMachine', | |
initial:'idle', | |
context:{ | |
deposited:0 | |
}, | |
states:{ | |
idle:{ | |
on:{ | |
SELECT_ITEM:{ |
NewerOlder