Using org-mode and Emacs Lisp to solve Advent of Code.
(org-babel-lob-ingest "./library-of-babel.org")
import CaseInsensitiveMap from './CaseInsensitiveMap'; | |
describe('CaseInsensitiveMap', () => { | |
it('should be able to construct', () => { | |
const map: Map<string, string> = new CaseInsensitiveMap<string>(); | |
}); | |
it('should be able to construct with values', () => { | |
const map: Map<string, string> = new CaseInsensitiveMap<string>([['key', 'value'], ['key2', 'value2']]); | |
}); | |
it('has case insensitive keys', () => { |
# https://developer.samsung.com/tv/develop/specifications/web-engine-specifications | |
chrome 47 # Tizen 3.0 2017 | |
chrome 56 # Tizen 4.0 2018 | |
chrome 63 # Tizen 5.0 2019 | |
# http://webostv.developer.lge.com/discover/webos-tv-platform/web-engine/ | |
chrome 38 # webOS TV 3.x 2016-2017 | |
chrome 53 # webOS TV 4.x 2018 |
sdb connect <ip>:<port> # connect to TV | |
sdb -s <deviceName> capability # get <installationPath> | |
# build | |
tizen cli-config "default.profiles.path=<profile_path>" | |
tizen build-web -out .buildResult -- <source-dir> | |
tizen package --type wgt --sign profileName -- <source-dir>/.buildResult # extract <package-file> | |
mv <package-file> . | |
rm -rf <source-dir>/.buildResult |
open System | |
let ( ..|..<++>..|.. ) x y = x + " " + y | |
let ( >.< ) x z = x ..|..<++>..|.. "." ..|..<++>..|.. "Thanks Obama." |> z | |
"custom operators" ..|..<++>..|.. "makes everything worse" >.< Console.WriteLine |
import { DotenvConfigOptions } from 'dotenv'; | |
const __DEV__ = process.env.NODE_ENV !== 'production'; | |
export type ConfigValue = { | |
value?: (v: string) => any; | |
} & ( | |
| { | |
required: true; | |
} |
import { RequestHandler } from 'express'; | |
/** | |
* Combine multiple middleware together. | |
* @param mids | |
*/ | |
export const combineHandlers = (...mids: RequestHandler[]): RequestHandler => | |
mids.reduce((a, b) => (req, res, next) => { | |
a(req, res, err => { | |
if (err) { |
/** | |
* Element.closest ponyfill | |
*/ | |
export function elementClosest(element: Element, selector: string): Element | null |
import { Observable, of } from "rxjs"; | |
import { map, switchMap } from "rxjs/operators"; | |
export class Nullable { | |
static isNotNull<T>(v: T): v is NonNullable<T> { | |
return v != null; | |
} | |
static bind = <T, R>( | |
project: (value: NonNullable<T>, index: number) => R |
Using org-mode and Emacs Lisp to solve Advent of Code.
(org-babel-lob-ingest "./library-of-babel.org")