Skip to content

Instantly share code, notes, and snippets.

@cdaringe
cdaringe / minwras_increase_per_columns.js
Created October 26, 2022 03:01
minwras_increase_per_columns.js
[
4,
5,
8,
10,
15,
20,
28,
39,
54,
@cdaringe
cdaringe / machine.js
Last active October 26, 2022 00:09
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@cdaringe
cdaringe / pnpm-patch-package.js
Created April 13, 2022 18:28
pnpm-patch-package.js
/**
* @description
* Support patch-package in pnpm projects.
*
* `pnpm` can be tricky to use with patch-package. To minimize friction creating patches,
* this script helps automate patching by using npm and a temp workspace to generate
* patch files.
*
* @usage
* 0. ensure the dependencies of interest are top level dependencies/devDependencies (no patching transitive deps)
@cdaringe
cdaringe / json-compactor.ts
Created May 26, 2020 20:07
json-compactor.ts
import * as fs from 'fs'
function isPrimitive (v: any) {
const tOfV = typeof v
if (tOfV === 'object') return false
if (v === null || tOfV === 'boolean' || tOfV === 'bigint' || tOfV === 'number' || tOfV === 'string' || tOfV === 'undefined') {
return true
}
return false
}
@cdaringe
cdaringe / path-demo.html
Created February 19, 2020 17:23
path-demo.html
<style>
path {
stroke-dasharray: 100;
animation: dash 1.8s linear infinite;
}
@keyframes dash {
to {
stroke-dashoffset: 200;
}
}
@cdaringe
cdaringe / dummy.svg
Created January 27, 2020 05:00
dummy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cdaringe
cdaringe / ink-svg-woes.svg
Created December 9, 2019 03:57
ink-svg-woes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cdaringe
cdaringe / raw-web-output.svg
Created December 9, 2019 03:55
raw-web-output.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cdaringe
cdaringe / svg-inkscape-debug.svg
Created December 7, 2019 21:50
svg-inkscape-debug.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cdaringe
cdaringe / multiline-format.rs
Created October 8, 2018 01:54
multiline-format.rs
let queryTemplate = r###"
{
user (login: "{owner}") {
repositoriesContributedTo(first: 5) {
edges {
node {
id
nameWithOwner
}
}