Skip to content

Instantly share code, notes, and snippets.

@crongro
crongro / machine.js
Created June 12, 2022 22:24
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'fetch',
initial: 'idle',
context: {
retries: 0
},
states: {
idle: {
@crongro
crongro / machine.js
Last active May 9, 2021 12:45
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@crongro
crongro / auto-merge.yml
Last active March 12, 2021 03:19
PR Merge on time
name: "PR Merge on time v2"
on:
schedule:
- cron: '00 13,16 * * *'
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
@crongro
crongro / .block
Created May 6, 2019 16:00 — forked from mbostock/.block
Radial Tidy Tree
license: gpl-3.0
border: no
height: 1060
redirect: https://beta.observablehq.com/@mbostock/d3-radial-tidy-tree
@crongro
crongro / radial-tidy-tree.js
Last active May 6, 2019 16:01
radial tidy tree (d3@v4, json based)
//idea : https://gist.github.com/mbostock/4063550
/*
* [renderSVG function]
* @d3 : d3 object (version 4.13.0)
* @data : json data (e.g. flare.json)
*/
export const renderSVG = (d3, data) => {
const svg = d3.select("svg"),
@crongro
crongro / main.js
Last active August 26, 2021 00:59
dbg
const sum = require("util");
function runProgram(arr) {
const result = sum(arr);
return `result is ${result}`;
}
const result = runProgram([undefined, 1,2,3,4,5,-1,"3"]);
console.log(result); //result is 14
@crongro
crongro / qna.css
Created January 23, 2019 06:11
qna
:root {
font-size: 16px;
--line: 1px solid #dad3d3
}
li {
list-style: none
}
h1 {
@crongro
crongro / tabui.css
Last active January 14, 2019 06:11
tabui
header,nav,section,div,footer,ul,dd {margin:0;padding:0;}
li{list-style: none;}
dt {
font-weight: bold;
font-size: 1.2em;
margin-bottom: 5px;
}
dl {
float: left;
@crongro
crongro / parse_after.js
Last active November 28, 2018 07:57
before_after
class Data {
constructor(type, value, child) {
this.type = type;
this.value = value;
this.child = child;
}
}
function scan(str) {
@crongro
crongro / polygonfortest.js
Last active April 25, 2023 12:51
test code source
export const printExecutionSequence = function() {
console.log(executionSequence.printAsStr());
return executionSequence.printAsStr();
}
export const executionSequence = (function() {
const sequence = [];
return {
update(str) {sequence.push(str);},
printAsStr() {