Skip to content

Instantly share code, notes, and snippets.

const date1 = new Date();
console.log(date1);
// дата передастся по ссылке:
// const date2 = date1;
// date1.getTime() => timestamp, количество миллисекунд, от 1 янв 1970
// чтобы сделать копию,
// можно передать как аргумент дату в конструктор
const date2 = new Date(date1);
@bespoyasov
bespoyasov / export-apple-notes.js
Last active May 10, 2024 14:47
Export content from the Apple Notes app.
/**
* Open Script Editor, change the current language to JavaScript, and paste the following code.
* You can also save the script as an app for faster access and run.
*
* By default, password-protected notes' content will be empty.
* For exporting protected notes as well, unlock them first.
*
* Based on: https://macmost.com/export-all-of-the-notes-on-your-mac-using-a-script.html,
* extends it with support for writing non-ASCII characters.
*/