Skip to content

Instantly share code, notes, and snippets.


bruce mcpherson brucemcpherson

View GitHub Profile
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 / .block
Last active Mar 27, 2018
D3 fisheye for navigating and visualizing Google Sheets
View .block
license: gpl-3.0
height: 400
scrolling: no
border: no
function doGet(e) {
var template = HtmlService.createTemplateFromFile('ht');
// Build and return HTML in IFRAME sandbox mode.
return template.evaluate();
function getThreads(options) {
brucemcpherson / cDbab.cls
Created Aug 18, 2014
Google Apps Script database abstraction - vba client
View cDbab.cls
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
View gist:ab8d86ce1bfb10a81121
' 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 / dbAbstraction.vba
Last active Apr 5, 2021
demo for how to use a variety of database backends, enabled by a google apps script backend, directly from VBA. for details see
View dbAbstraction.vba
Option Explicit
' this is how to use Google Apps Script dbabstration web app from Excel.
' version 0.2
' 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 / custommapping.js
Created Feb 5, 2014
custom code class for googlemapping.xlsm
View custommapping.js
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;
brucemcpherson / deadDropping.vba
Last active Aug 29, 2015
some example functions for deaddrop scriptdb
View deadDropping.vba
Option Explicit
' register this computer for deaddrop
Public Sub registerDeadDrop()
Dim ds As cDataSet, cc As cCell, fName As String, sf As String
Set ds = New cDataSet
With ds.populateData(wholeSheet(cGeoCodingParameters), , , True, cCustomCode)
Set cc = .cell("local register", "code")
If Not cc Is Nothing Then
brucemcpherson / scriptDbCom.xml
Last active Apr 11, 2021
gistthat manifest for scriptdbcom - VBA scriptDB API
View scriptDbCom.xml
<gistThat info="this is a manifest for gistThat VBA code distribution - see for details">
<manifest description="cDataset and associated classes and modules" contact="">
<item1 gistid="3414216" version="" filename="cCell.cls" module="cCell" type="class" />
<item2 gistid="3414216" version="" filename="cDataSet.cls" module="cDataSet" type="class" />
<item3 gistid="3414216" version="" filename="cDataSets.cls" module="cDataSets" type="class" />
<item4 gistid="3414216" version="" filename="cDataColumn.cls" module="cDataColumn" type="class" />
<item5 gistid="3414216" version="" filename="cDataRow.cls" module="cDataRow" type="class" />
<item6 gistid="3414216" version="" filename="cHeadingRow.cls" module="cHeadingRow" type="class" />
<item7 gistid="3414346" version="" filename="" module="usefulStuff" type="module" />