Skip to content

Instantly share code, notes, and snippets.

@crongro
crongro / historyAPI.html
Last active May 22, 2023 08:44
history API Example
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Untitled</title>
<style>
h1 {
color: red;
}
@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() {
@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 / 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 / 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 / o.js
Last active November 4, 2020 07:14
object ex
const data = {
"debug": "on",
"window": {
"title": "Sample Konfabulator Widget",
"name": "main_window",
"width": 500,
"height": 500
},
"image": {
"src": "Images/Sun.png",
@crongro
crongro / json_tree.js
Last active April 5, 2020 09:48
json_tree
[{
"id": 1,
"name": "Yong",
"phone": "010-0000-0000",
"type": "sk",
"childnode": [{
"id": 11,
"name": "echo",
"phone": "010-0000-1111",
"type": "kt",
@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 / .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