Skip to content

Instantly share code, notes, and snippets.

@dominikwilkowski
dominikwilkowski / README.md
Created September 5, 2020 02:57
ANSI codes for cli controled output

ANSI escape codes

ANSI escape codes can be printed to a shell to as instructions. The below is a list of codes I have used often in my CLI programs and I find myself looking up over and over again.

A great article about it can be found here.

Content

@acomagu
acomagu / deepmerge.ts
Last active February 2, 2022 13:47
Strongly typed deepmerge implementation.
type IsObject<T> = T extends object ? T extends any[] ? false : true : false;
function isObject<T>(v: T): IsObject<T> {
return (typeof v === 'object' && !Array.isArray(v)) as IsObject<T>;
}
type Merge2<T, U> = IsObject<T> & IsObject<U> extends true ? {
[K in keyof T]: K extends keyof U ? Merge2<T[K], U[K]> : T[K];
} & U : U;
@darth-veitcher
darth-veitcher / WDTVLive.xml
Created January 12, 2014 12:53
WDTV device profile.xml for Plex Media Server
<Client name="WD TV Live HD Media Player">
<!-- Author: Plex Inc. -->
<!-- http://www.wdc.com/w...4779-705035.pdf -->
<!-- Model number tested: WDBAAN0000NBK -->
<!-- TODO - a few more limitations around codec profiles, which are high enough that they're probably not worth listing at present -->
<Identification>
<Header name="User-Agent" substring="alphanetworks" />
<Header name="User-Agent" substring="ALPHA Networks" />
</Identification>
<Settings>