Skip to content

Instantly share code, notes, and snippets.

View ishabo's full-sized avatar

Joshua ishabo

  • YodaTek LTD
  • London
View GitHub Profile
@ishabo
ishabo / machine.js
Last active December 30, 2020 19:17
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'Player',
initial: 'loading',
context: {
hasLoaded: false,
isSeeking: false,
hasPlayed: false,
shouldPause: true
},
on: {
@ishabo
ishabo / .vimrc
Last active August 14, 2020 23:11
Issa's VIM file
if empty(glob('~/.vim/autoload/plug.vim'))
silent execute "!curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
autocmd VimEnter * PlugInstall | source $MYVIMRC
endif
if (has("termguicolors"))
set termguicolors
endif
call plug#begin('~/.vim/plugged')
@ishabo
ishabo / machine.js
Last active April 4, 2020 20:08
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ishabo
ishabo / machine.js
Last active February 24, 2020 15:53
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ishabo
ishabo / machine.js
Last active February 24, 2020 14:31
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ishabo
ishabo / machine.js
Created February 17, 2020 17:06
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ishabo
ishabo / machine.js
Last active February 17, 2020 14:30
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ishabo
ishabo / machine.js
Last active October 21, 2019 16:17
Generated by XState Viz: https://xstate.js.org/viz
"use strict";
const defaultContext = {
totalSavings: 10000,
taxFreeLumpSum: 0,
latestPot: '',
availableSavings: 0,
pots: {
flexibleIncomePot: {
potName: 'flexibleIncomePot',
potType: 'income',
@ishabo
ishabo / machine.js
Created October 14, 2019 12:34
Generated by XState Viz: https://xstate.js.org/viz
"use strict";
// const services = {
// validateInput: (ctx: IPotContext) =>
// validateInput(ctx.allocatedAmount, ctx.minimumAmountAllowed),
// fetchProjections: (ctx: IPotContext): Pormise<IProjections> => fetchProjections(ctx.allocatedAmount),
// };
const getPot = (ctx) => {
if (!ctx.currentPot) {
throw new Error('Attempted to get currentPot from illustration machien context but it was not set');
}
@ishabo
ishabo / machine.js
Last active October 14, 2019 17:42
Generated by XState Viz: https://xstate.js.org/viz
const getPot = (ctx) => {
if (!ctx.currentPot) {
// throw new Error(
// 'Attempted to get currentPot from illustration machien context but it was not set',
// );
return {};
}
return ctx.pots[ctx.currentPot];
};
const updatePot = (obj, e) => assign({