Skip to content

Instantly share code, notes, and snippets.

QuickBooks requires links for Terms of Service for productions apps.
So here they be.
End User License Agreement
You, as the user of this phenomenal product, can only use it to do what it does.
Since you can't make it do anything it doesn't do, you are required to refrain from
causing undue stress by asking it to do those things it can not do.
Privacy Policy
We don't much care about anything of yours but we do have to use the data in you account or why would we make this?
@BobRupholdt
BobRupholdt / sort-tabs.gs
Last active March 6, 2020 15:12 — forked from bpmore/sort-tabs.txt
Sort Tabs in Google Spreadsheets
/*
Sort sheets in a Google spreadsheet.
Allows specifying first/last sheets as arrays of sheet names
Requires Apps Script runtime powered by Chrome V8 (not Rhino)
*/
function sortSheets(){sortSheets_(first=[config.indexSheetName], last=["log"]);}
function sortSheets_ (first=[],last=[]) {
if(!Array.isArray(first)) throw "Parameter 'first' must be an array";
Running total of column B
=ArrayFormula(
IF(ISNUMBER(B2:B),
MMULT(
TRANSPOSE((ROW(B2:B)<=TRANSPOSE(ROW(B2:B)))*B2:B),
SIGN(B2:B)
),
IFERROR(1/0))
)
@BobRupholdt
BobRupholdt / gist:f1c426ae94959eca1d670bda4e3f0a3b
Created April 7, 2018 06:33
Break large JSON into an array of smaller objects. I made this for Google Apps Script to break large API results into smaller chunks for moving into Firebase. This assumes that each key in the object is a record.
function splitObject_TEST(){Logger.log(splitObject({1:11,2:22,3:33,4:44,5:55,6:66,7:77}, 3))}
function splitObject(data, size){
if(Object.keys(data).length <= size)
return [data];
var count = 0;
var out = [];
for (var key in data) {
var bowl = Math.floor((count++)/size);
@BobRupholdt
BobRupholdt / UbuntuSwapfile.txt
Last active May 26, 2017 02:40
Adding swap file on DigitalOcean 512mb Ubuntu droplet so npm install will complete
# check for swapfile
sudo swapon -s
# if there is one
# swapoff -a
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024k
sudo mkswap /swapfile
sudo swapon /swapfile
#swapfile should show now with
swapon -s
# set swappiness to keep the server happy