Common HTML element reference
// BEFORE
const htmlRef = useRef<HTMLDivElement>()
// AFTER
const htmlRef = useRef<ElementRef<'div'>>() // <-- such convenience
Common HTML element reference
// BEFORE
const htmlRef = useRef<HTMLDivElement>()
// AFTER
const htmlRef = useRef<ElementRef<'div'>>() // <-- such convenience
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"type": "object", | |
"default": { | |
"pages": [ | |
{ | |
"url": "/my-url/", | |
"is_indexable": true | |
} | |
] |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
function productWorkWeek () { | |
/* | |
* On any good product day you start by drinking that sweet bean juice; oh the | |
* joys of a socially accepted chemical addiction hehe. | |
*/ | |
startTheDayWithCoffee(); | |
return function finishWorkWeekEarly () { | |
window.cancelAnimationFrame(window.savepointLolJokeThisIsRealLife); | |
} |
tell application "Notes" | |
set theMessages to every note | |
repeat with thisMessage in theMessages | |
set myTitle to the name of thisMessage | |
set myText to the body of thisMessage | |
set myCreateDate to the creation date of thisMessage | |
set myModDate to the modification date of thisMessage |
import { styled, StylesProvider } from 'element-styles' | |
// 1. Default styles | |
const defaults = { | |
container: { border: 'solid 3px currentColor', background: 'white' }, | |
inner: { color: 'currentColor' } | |
} | |
@styled(defaults) | |
class Button extends Component { ... } |
import { styled } from 'element-styles' | |
@styled() | |
class Button extends Component { | |
render () { | |
const { styles, children, ...props } = this.props; | |
return ( | |
<button {...props} {...styles('container')}> | |
<span {...styles('inner')}>{children}</span> |
/* | |
|------------------------------------------------------------------------------- | |
| Custom 'module resolver' for Jest | |
|------------------------------------------------------------------------------- | |
| | |
| Forked from Jest, this is the default 'resolver' with the added benefit of | |
| remapping the "main" field to the value of the "module" field, when present. | |
| | |
*/ |
function build_pack () { | |
echo "Building & packing \"$(basename $(pwd))\"" && \ | |
yarn build && npm pack && \ | |
echo "Packed! Bai!" | |
} | |
function link_pack () { | |
package_name="${1:?required}" |