Skip to content

Instantly share code, notes, and snippets.

View 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)
View 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
}
View path-demo.html
<style>
path {
stroke-dasharray: 100;
animation: dash 1.8s linear infinite;
}
@keyframes dash {
to {
stroke-dashoffset: 200;
}
}
View dummy.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View ink-svg-woes.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View raw-web-output.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View svg-inkscape-debug.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View multiline-format.rs
let queryTemplate = r###"
{
user (login: "{owner}") {
repositoriesContributedTo(first: 5) {
edges {
node {
id
nameWithOwner
}
}
View gatsby-config.js
const markdown = [
`gatsby-plugin-sharp`,
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `gatsby-remark-images`,
options: { maxWidth: 590 }
},
@cdaringe
cdaringe / react-super-hoc-design.md
Last active Aug 15, 2018
react-super-hoc-design
View react-super-hoc-design.md

problem

higher-order components must provide

  • easily extensible layouts
  • good default components
  • mechanisms to control default components
  • easily extensible/swappable components

providing a "free" high-level tree of components whilst offering low-level extensibility can