Skip to content

Instantly share code, notes, and snippets.

View nhducit's full-sized avatar
🚀

nhducit nhducit

🚀
View GitHub Profile
@nhducit
nhducit / machine.js
Last active October 4, 2021 13:59
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@nhducit
nhducit / machine.js
Created April 21, 2020 11:03
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@nhducit
nhducit / machine.js
Created April 21, 2020 06:23
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@nhducit
nhducit / machine.js
Last active March 31, 2020 17:00
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@nhducit
nhducit / machine.js
Created January 4, 2020 15:54
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@nhducit
nhducit / machine.js
Created December 31, 2019 09:10
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
.monaco-shell {
font-family: 'Operator Mono', 'Fira code', 'Inconsolata', monospace;
letter-spacing: 0.5px;
}
.vs-dark .monaco-panel-view .panel > .panel-header > .title {
font-weight: normal;
letter-spacing: 1px;
}
.vs-dark .monaco-workbench > .part.titlebar > .window-title {
color: #fafafa;
@nhducit
nhducit / rebase-latest-master.sh
Last active May 29, 2018 04:03
rebase latest master for lazy people
#!/usr/bin/env bash
cd <projectDir>
currentBranch=$(git rev-parse --abbrev-ref HEAD)
git checkout master
git pull
git checkout $currentBranch
git rebase master
import Reconciler from 'react-reconciler'
import omit from 'lodash/omit'
import capitalize from 'lodash/capitalize'
import { actions as elementActions } from './store/elements'
import * as Elements from './elements'
const roots = new Map()
const emptyObject = {}
const Renderer = Reconciler({
@nhducit
nhducit / Regex maskify.md
Created December 8, 2016 11:04
write a function maskify, which changes all but the last four characters into '#'

Question:

write a function maskify, which changes all but the last four characters into '#'
Eg:
maskify('4556364607935616') # should return '############5616'
maskify('64607935616')      # should return '#######5616'
maskify('1')                # should return '1'
maskify('')                 # should return ''