Skip to content

Instantly share code, notes, and snippets.

View machine.js
const fetchMachine = Machine({
id: 'fetch',
initial: 'idle',
context: {
retries: 0
},
states: {
idle: {
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@crongro
crongro / auto-merge.yml
Last active Mar 12, 2021
PR Merge on time
View auto-merge.yml
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 — forked from mbostock/.block
Radial Tidy Tree
View .block
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
radial tidy tree (d3@v4, json based)
View radial-tidy-tree.js
//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"),
View main.js
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
View qna.css
:root {
font-size: 16px;
--line: 1px solid #dad3d3
}
li {
list-style: none
}
h1 {
View tabui.css
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 Nov 28, 2018
before_after
View parse_after.js
class Data {
constructor(type, value, child) {
this.type = type;
this.value = value;
this.child = child;
}
}
function scan(str) {
@crongro
crongro / polygonfortest.js
Last active Feb 5, 2021
test code source
View polygonfortest.js
export const printExecutionSequence = function() {
console.log(executionSequence.printAsStr());
return executionSequence.printAsStr();
}
export const executionSequence = (function() {
const sequence = [];
return {
update(str) {sequence.push(str);},
printAsStr() {