Skip to content

Instantly share code, notes, and snippets.

View lancejpollard's full-sized avatar
😍
Lots of coding

Lance Pollard lancejpollard

😍
Lots of coding
View GitHub Profile
@lancejpollard
lancejpollard / parse.ts
Last active July 9, 2024 02:13
Parse Tibetan Syllables (attempt)
const PREFIXES = ['ག', 'ད', 'བ', 'མ', 'འ']
const SUPERSCRIPTS = ['ར', 'ལ', 'ས']
const EXTENDED_ROOT_LETTERS = [
'ཫ',
'ཬ',
'ཁ༹',
'ག༹',
'ཕ༹',
'བ༹',
'གྷ',
@lancejpollard
lancejpollard / signlist.json
Created July 7, 2024 21:18
Cuneiform Sign List JSON (from ORACC)
{
"\u02beu4": ["\ud808\udc00"],
"a": ["\ud808\udc00"],
"aia2": ["\ud808\udc00"],
"aya2": ["\ud808\udc00"],
"barx": ["\ud808\udc00", "\ud808\udf0b"],
"buni\u014bx": ["\ud808\udc00", "\ud808\udc00\ud808\uddb9"],
"burx": [
"\ud808\udc00",
"\ud808\udc41\ud808\udd46\ud808\udc41",
@lancejpollard
lancejpollard / datetime.md
Last active April 23, 2024 09:12
Universal Time Representation (Idea)

A DateTime should really be treated as a TimeSpan which is taken as the difference from a standard reference point (like Jan 1, 1970). Something like that:

// 2024
const y2024 = { year: 2024 } | { thousand: 2, year: 24 }
// 2000BCE = -2000 - 1970
const y2000bce = { year: -3970 }
// 13.8bya
const t13_8bya = { billion: -13, million: -8 }
@lancejpollard
lancejpollard / leaf.ts
Created February 5, 2024 22:50
AWS Lambda file uploader
import _ from 'lodash'
import { ReadStream } from 'fs'
import busboy, { FileInfo } from 'busboy'
import DEBUG from 'debug'
import kink from './kink.js'
import { Event } from './router.js'
const debug = DEBUG('load-file')
export type HandleFileInput = {
@lancejpollard
lancejpollard / leaf.ts
Created February 5, 2024 19:54
BusBoy with Express, like Multer but not middleware and a little cleaner
import { Request, Response } from 'express'
import _ from 'lodash'
import { ReadStream } from 'fs'
import onFinished from 'on-finished'
import busboy, { FileInfo } from 'busboy'
import DEBUG from 'debug'
import kink from './kink.js'
const debug = DEBUG('load-file')
@lancejpollard
lancejpollard / parse.js
Last active February 21, 2024 11:42
FFmpeg data collections in JSON (filters, encoders, decoders, codecs, and formats)
const fs = require('fs')
const codecs = ` D.VI.S 012v Uncompressed 4:2:2 10-bit
D.V.L. 4xm 4X Movie
D.VI.S 8bps QuickTime 8BPS video
.EVIL. a64_multi Multicolor charset for Commodore 64 (encoders: a64multi)
.EVIL. a64_multi5 Multicolor charset for Commodore 64, extended with 5th color (colram) (encoders: a64multi5)
D.V..S aasc Autodesk RLE
D.V.L. agm Amuse Graphics Movie
D.VIL. aic Apple Intermediate Codec
@lancejpollard
lancejpollard / licences.json
Created December 17, 2023 20:37
licenses.json
{
"licenseListVersion": "ef5a479",
"licenses": [
{
"reference": "https://spdx.org/licenses/0BSD.html",
"isDeprecatedLicenseId": false,
"detailsUrl": "https://spdx.org/licenses/0BSD.json",
"referenceNumber": 532,
"name": "BSD Zero Clause License",
"licenseId": "0BSD",
@lancejpollard
lancejpollard / itt-coc.ts
Created December 6, 2023 05:09 — forked from VictorTaelin/itt-coc.ts
ITT-Flavored Calculus of Constructions Type Checker
// A nano dependent type-checker featuring inductive types via self encodings.
// All computation rules are justified by interaction combinator semantics,
// resulting in major simplifications and improvements over old Kind-Core.
// A more complete file, including superpositions (for optimal unification)
// is available on the Interaction-Type-Theory repository.
// Credits also to Franchu and T6 for insights.
// This is a new development, may have bugs (:
// Lists
type List<A> =
@lancejpollard
lancejpollard / list.md
Last active May 2, 2024 09:07
Phrase structure rule abbreviations (partial)
S - Sentence
NP - Noun Phrase
VP - Verb Phrase
PP - Prepositional Phrase
AdvP - Adverb Phrase
AdjP - Adjective Phrase
Det - Determiner
N - Noun
V - Verb
@lancejpollard
lancejpollard / readme.md
Last active February 21, 2024 11:43
List Hunspell Dictionaries