Skip to content

Instantly share code, notes, and snippets.

@amoghs
amoghs / gsheets.js
Last active October 11, 2023 06:26
Add a Summary cell for each row so the eesel Oracle can understand it better
function summarizeSheet() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var sheetName = sheet.getName();
var lastRow = sheet.getLastRow();
var lastColumn = sheet.getLastColumn();
var headers = sheet.getRange(1, 1, 1, lastColumn).getValues()[0];
var allRowData = sheet.getRange(2, 1, lastRow - 1, lastColumn).getValues(); // Get all row data at once
for (var row = 0; row < allRowData.length; row++) {
var rowData = allRowData[row];
@amoghs
amoghs / upload.js
Last active August 8, 2022 14:33
A script to upload eesel data
;(() => {
const input = document.createElement('input')
input.type = 'file'
input.addEventListener(
'change',
() => {
const [file] = input.files
const reader = new FileReader()
reader.readAsText(file)
@amoghs
amoghs / download.js
Last active September 23, 2022 07:53
A script to download your eesel data
;(function openTransaction(databaseVersion) {
let request = indexedDB.open('main', databaseVersion)
request.onsuccess = async (event) => {
const db = event.target.result
const objectStoreNameList = [
'commandList',
'commandHistoryEntryList',
'documentList',
'productList',