Skip to content

Instantly share code, notes, and snippets.

View brucemcpherson's full-sized avatar

bruce mcpherson brucemcpherson

View GitHub Profile
initial
initial
@brucemcpherson
brucemcpherson / 0d8966d54a43723ccb464492879ef94961e1d35c
Last active March 13, 2024 15:47
filename:appsscript extension:.json
This file has been truncated, but you can view the full file.
function doPost(e) {
// some defaults for standalone testing
e = e || {postData:{contents:"<a>a</a>"}};
e.queryString = e.queryString || "convert=xmltojson" ;
var type = e.queryString.toLowerCase().split("=");
// convert xml to json
var results = {status:"bad", error:"no errors"};
try {
@brucemcpherson
brucemcpherson / .block
Last active March 27, 2018 10:27
D3 fisheye for navigating and visualizing Google Sheets
license: gpl-3.0
height: 400
scrolling: no
border: no
@brucemcpherson
brucemcpherson / code.gs
Created September 23, 2016 10:29
mailtabgs
function doGet(e) {
var template = HtmlService.createTemplateFromFile('ht');
// Build and return HTML in IFRAME sandbox mode.
return template.evaluate();
}
function getThreads(options) {
@brucemcpherson
brucemcpherson / cDbab.cls
Created August 18, 2014 14:06
Google Apps Script database abstraction - vba client
Option Explicit
' v1.0
' this one manages interaction with dbAbstraction on Google Apps Script
Private pDbId As String
Private pSiloId As String
Private pResult As cDbAbResult
Private poAuth2 As cOauth2
Private pEndPoint As String
Private pDbName As String
Private pBrowser As cBrowser
' use like this =displayAnOldDate(makeAnOldDate(1891,1,2))
Option Explicit
Public Function makeAnOldDate(y As Long, m As Long, d As Long) As Double
makeAnOldDate = DateSerial(y, m, d)
End Function
Public Function displayAnOldDate(oldDate As Double) As String
displayAnOldDate = Format(oldDate, "dd-mmm-yyyy")
End Function
@brucemcpherson
brucemcpherson / dbAbstraction.vba
Last active April 5, 2021 19:27
demo for how to use a variety of database backends, enabled by a google apps script backend, directly from VBA. for details see http://ramblings.mcpher.com/Home/excelquirks/dbapps/dbvariety
Option Explicit
' this is how to use Google Apps Script dbabstration web app from Excel.
' version 0.2
' http://ramblings.mcpher.com/Home/excelquirks/dbabstraction
' http://ramblings.mcpher.com/Home/excelquirks/googleoauth2 for how to set up yor pc for oauth2
Public Sub demoDBAccess()
Dim data As cJobject
Dim siloId As String, places As cJobject, place As cJobject, result As cJobject, _
sheetId, driveFolder As String, fusionId As String
@brucemcpherson
brucemcpherson / custommapping.js
Created February 5, 2014 13:50
custom code class for googlemapping.xlsm ramblings.mcpher.com
function cCustomMapping(options) {
// customize one of these for specific behavior during map usage
// the functions below must do at least as shown in this skeleton - add your own in addition.
var self = this;
var pOptions = options,
pData, pMap, pParams, pDb;
self.getOptions = function () {
return pOptions;