Based on https://bl.ocks.org/officeofjane/2c3ed88c4be050d92765de912d71b7c4
(gist: https://gist.github.com/officeofjane/2c3ed88c4be050d92765de912d71b7c4 )
MIT licensed.
Use node process.node.js
to split into separate layout files.
#!/bin/bash | |
# Like docker compose build [SERVICE]. | |
# | |
# USAGE: ddev-build [SERVICE] | |
# | |
function ddev-build { | |
~/.ddev/bin/docker-compose -f .ddev/.ddev-docker-compose-full.yaml build $1 --no-cache --progress=plain | |
} |
<body> | |
<svg viewBox="0 0 200 200" height="200"> | |
<circle cx="100" cy="100" r="90" pathLength="1" transform="rotate(-90 100 100)" class="percentage" stroke-dashoffset="0.9"></circle> | |
</svg> | |
<p> | |
Set percentage: | |
<button type="button">0</button> | |
<button type="button">15</button> | |
<button type="button">50</button> |
Based on https://bl.ocks.org/officeofjane/2c3ed88c4be050d92765de912d71b7c4
(gist: https://gist.github.com/officeofjane/2c3ed88c4be050d92765de912d71b7c4 )
MIT licensed.
Use node process.node.js
to split into separate layout files.
type RGB = [number, number, number]; | |
export function parseRgb(color: RGB | string): RGB { | |
if (Array.isArray(color)) { | |
return color; | |
} | |
let c = color; | |
let m; | |
if ( |
#!/bin/bash | |
# Script is needed because my default firewall rules are messed up and after | |
# every restart, docker containers can't make connections to the host, notably | |
# preventing debuggers like xdebug from attaching. | |
# If networking fails in your containers but works in others, rm and re-create the | |
# docker network that container is bound to. | |
set -euo pipefail |
import { useEffect, useRef } from 'react'; | |
export default function usePrevious<T, U>(value: T, init: U): T | U { | |
const ref = useRef<T | U>(init); | |
useEffect(() => { | |
ref.current = value; | |
}); | |
return ref.current; | |
} |
function isRichValue(value) { | |
return Boolean(value && Array.isArray(value.richText)); | |
} | |
function richToString(rich) { | |
return rich.richText.map(({ text }) => text).join(''); | |
} | |
function richToHtml(rich) { | |
let str = rich.richText.map(({ font = {}, text }) => { |
#!/bin/bash | |
# Like docker compose logs -f but it waits for containers to come back up | |
# if they stop or haven't been started. | |
# | |
# USAGE: dclogs [SERVICE] | |
# | |
function dclogs { | |
# If in ddev project, use ddev's full config file | |
if [ -d ".ddev" ]; then |
// Recursively create all combinations of the remaining items--at least those | |
// that are valid and aren't longer than those we've tested so far. | |
function buildCombinations(remaining, combo, process) { | |
process.recordIteration(); | |
for (let i = 0; i < remaining.length; i++) { | |
if (process.isDone()) { | |
// global short-circuit | |
return; | |
} |
<?php | |
namespace MrClay; | |
/** | |
* HTML class list based on DOMTokenList | |
* | |
* @link https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList | |
*/ | |
class ClassList |