Skip to content

Instantly share code, notes, and snippets.

@pauloromeira
pauloromeira / apps_script-balance_portfolio.gs
Last active September 20, 2021 03:21
Apps Script (Google Sheets) - Balance Portfolio
/* ---------- General Helpers ---------- */
function _sort_idxs(items) {
return items.map((item, idx) => [item, idx]).sort().map(i => i[1]);
}
function _sort_apply(idxs, items) {
return idxs.map(idx => items[idx]);
}
@pauloromeira
pauloromeira / 0_README.md
Last active November 13, 2023 11:33
Simple backup to external device script

Simple backup to external device

This just sync any folder with an external device by using crontab. It's meant to run sparsely, hence it mounts and unmounts the device on every execution.

It consists of two scripts:

  1. with_device.sh: mounts and umounts the external device - should be in a folder with restricted access
  2. simple_backup.sh: does the actual backup using rsync - can be in any folder

Crontab sample: