Skip to content

Instantly share code, notes, and snippets.

@brettz9
brettz9 / config.cson
Last active April 5, 2022 06:04
My current Atom config
"*":
Hydrogen:
debug: true
kernelNotifications: true
"atom-easy-jsdoc":
beta: true
useReturns: true
"atom-ide-datatip": {}
"atom-ide-outline":
initialDisplay: false
@brettz9
brettz9 / jsdoc.md
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.mov" "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)
configuration:
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
brettz9 / package-list.txt
Last active March 29, 2021 13:43
Atom (and starred) package list generated by `apm list --bare > package-list.txt` adapted from instructions at https://discuss.atom.io/t/installed-packages-list-into-single-file/12227/2 (I removed the --installed flag to be safe though the list with the flag is in the first comment below; also note that after some installs, they didn't show up i…
atom-dark-syntax@0.29.1
atom-dark-ui@0.53.3
atom-light-syntax@0.29.1
atom-light-ui@0.46.3
base16-tomorrow-dark-theme@1.6.0
base16-tomorrow-light-theme@1.6.0
one-dark-ui@1.12.5
one-light-ui@1.12.5
one-dark-syntax@1.8.4
one-light-syntax@1.8.4
@brettz9
brettz9 / Array.prototype.slice.html
Last active February 18, 2021 06:54
(NOTE: This has been since improved to handle negative values at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice#Streamlining_cross-browser_behavior ); Polyfill for "fixing" IE's lack of support (IE < 9) for applying slice on host objects like NamedNodeMap, NodeList, and HTMLCollection (technically, s…
<!DOCTYPE html>
<body id="body" class="abc"><script src="Array.prototype.slice.js"></script><script src="testing-Array.prototype.slice.js"></script>
</body>
@brettz9
brettz9 / detectEnv.js
Last active February 13, 2021 18:03
Detecting Node version for Node-based configs. Hope to integrate into an [mrm](https://github.com/sapegin/mrm) task.
'use strict';
// Todo: Move to own repo
/**
* You can use this in your `.eslintrc.js` as follows...
*
* @example
*
* 'use strict';
@brettz9
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: https://github.com/brettz9/jamilih
'use strict';
window.hyperJamilih = (() => {
const map = new Map();
const {bind: hyper} = hyperHTML;
@brettz9
brettz9 / Array.from.js
Last active December 9, 2020 01:42
Array.from polyfill (see also https://github.com/mathiasbynens/Array.from )
/**
* @license MIT, GPL, do whatever you want
* @requires polyfill: Array.prototype.slice fix {@link https://gist.github.com/brettz9/6093105}
*/
if (!Array.from) {
Array.from = function (object) {
'use strict';
return [].slice.call(object);
};
}
@brettz9
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