Skip to content

Instantly share code, notes, and snippets.

View MrChocolatine's full-sized avatar
Away, unlikely to answer.

MrChocolatine

Away, unlikely to answer.
  • Remote Island
View GitHub Profile
@MrChocolatine
MrChocolatine / TS - More precise return type method Date#toISOString.d.ts
Last active February 22, 2024 22:06
TypeScript – How to accurately type dates in ISO 8601 format
// In TS, interfaces are "open" and can be extended
interface Date {
/**
* Give a more precise return type to the method `toISOString()`:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
*/
toISOString(): TDateISO;
}
type TYear = `${number}${number}${number}${number}`;
@MrChocolatine
MrChocolatine / macOS – Remove metadata from PDF files.md
Last active April 5, 2024 16:09
macOS – Remove metadata from PDF files