Skip to content

Instantly share code, notes, and snippets.

brettz9 / settings.json
Created December 10, 2022 21:29
User settings for VSC (work in progress): ~/Library/Application Support/Code/User/settings.json
"gitlens.hovers.currentLine.over": "line",
"gitlens.currentLine.enabled": false,
"gitlens.codeLens.enabled": false,
"gitlens.hovers.enabled": false,
"editor.accessibilitySupport": "off",
"editor.fontSize": 17,
"editor.minimap.enabled": false,
"editor.acceptSuggestionOnEnter": "off",
"editor.quickSuggestions": { "other": false, "comments": false, "strings": false },
brettz9 / javascript.json
Last active November 4, 2023 18:22
VSC JS snippets (work in progress): ~/Library/Application Support/Code/User/snippets/javascript.json
// Place your snippets for javascript here. Each snippet is defined under
// a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and
// the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position,
// and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
brettz9 /
Last active March 2, 2022 23:18
Plain JavaScript + JSDoc with TypeScript tools. **Disclaimer**: I'm still rather a noob to TypeScript

Plain JavaScript + TypeScript-flavored JSDoc (i.e., no need for TypeScript syntax)

Here are some basic tips for beginners trying to use TypeScript tooling against plain JavaScript + JSDoc files.

TypeScript-style documentation syntax is JSDoc, it's just a different dialect of JSDoc as far as which JSDoc tags have formally defined behavior, what the types are (there are many more available in the TypeScript flavor), and what the allowable syntax is (the TypeScript team tried to hew closely to JSDoc, but they avoided @module in favor of allowing import() of third party types and they don't yet support certain tags in a type-aware way--though for doc tools unrelated to type-checking it might not matter).

$ ffmpeg -i "" "Efficient-Searches-and-Shortcuts-1-SD-480p.webm"
ffmpeg version 3.3.4 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.37)
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100

I understand your argument about force, and although I very much sympathize with the general tendency to seek to do things without what one could in a sense call "force", I think there are a few factors which are obscuring matters here.

For one, I think we have to be careful that we are not engaging in a fallacy of equivocation. While it is especially disconcerting to see "force" being used ot justify even well-intended behaviors, when understood as compulsion under threat of violence or imprisonment by the state, obviously we are not talking about anything remotely similar in degree here (assuming all would even agree that this is indeed a form of compulsion at all).

So saying "it's always wrong to force things on people" might be seen as gaining credence by attacking the strawman of a supposed claim justifying physical compulsion. This brings me to my second point which is about the polemical-sounding nature of engagement with such a fallacy.

Polemicists use ambiguous language such as this to obscure mat

brettz9 / detectEnv.js
Last active February 13, 2021 18:03
Detecting Node version for Node-based configs. Hope to integrate into an [mrm]( task.
'use strict';
// Todo: Move to own repo
* You can use this in your `.eslintrc.js` as follows...
* @example
* 'use strict';
brettz9 / resolve.js
Last active April 23, 2020 12:52
Promise-based `resolve`
import resolve from './resolve.js';
await resolve('tap', { basedir: __dirname });
const _resolve = require('resolve');
const resolve = (path, opts = {}) => {
// eslint-disable-next-line promise/avoid-new
return new Promise((resolve, reject) => {
// eslint-disable-next-line promise/prefer-await-to-callbacks
brettz9 / .eslintignore
Last active February 26, 2020 09:14
Disabling of mostly stylistic rules when applying eslint-config-ash-nazg (for linting other projects or node_modules); should split these out within ash-nazg; also has overrides used for linting others' projects
# dist
# very unfortunately, it seems this can't be overridden apparently
# per
# "ESLint always ignores files in /node_modules/* and /bower_components/*"
brettz9 / hyperJML.js
Last active January 19, 2021 13:13
hyperhtml wrapper (not currently put to use or tested)
/* globals hyperHTML, jml, Interpolator */
// Relies on getInterpolator of Jamilih:
'use strict';
window.hyperJamilih = (() => {
const map = new Map();
const {bind: hyper} = hyperHTML;
brettz9 / pug-i18n.js
Created January 19, 2020 11:51
pug i18n
'use strict';
// Todo: Move to own repo
const {i18n} = require('intl-dom');
const walk = require('pug-walk');
const fileFetch = require('file-fetch');
global.fetch = fileFetch; // For `intl-dom`