Skip to content

Instantly share code, notes, and snippets.

bruce mcpherson brucemcpherson

Block or report user

Report or block brucemcpherson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View XMLJSONbyGAS.gs
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 Mar 27, 2018
D3 fisheye for navigating and visualizing Google Sheets
View .block
license: gpl-3.0
height: 400
scrolling: no
border: no
View code.gs
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 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
brucemcpherson / dbAbstraction.vba
Last active Apr 21, 2017
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
View dbAbstraction.vba
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 Feb 5, 2014
custom code class for googlemapping.xlsm ramblings.mcpher.com
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
brucemcpherson / deadDropping.vba
Last active Aug 29, 2015
some example functions for deaddrop scriptdb
View deadDropping.vba
Option Explicit
'v1.1
' 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
brucemcpherson / scriptDbCom.xml
Last active Aug 29, 2015
gistthat manifest for scriptdbcom - VBA scriptDB API
View scriptDbCom.xml
<gistThat info="this is a manifest for gistThat VBA code distribution - see ramblings.mcpher.com for details">
<manifest description="cDataset and associated classes and modules" contact="bruce@mcpher.com">
<gists>
<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" />
View cDeadDrop.cls
'gistThat@mcpher.com :do not modify this line - see ramblings.mcpher.com for details: updated on 2/3/2014 6:52:09 PM : from manifest:8767201 gist https://gist.github.com/brucemcpherson/7943765/raw/cDeadDrop.cls
Option Explicit
' v1.2
Private pScriptDb As cScriptDbCom
Private pPackage As cJobject
Private Const deadDropKey = "xLiberationConversations"
Public Property Get willExpireAt() As Date
willExpireAt = DateAdd("n", 24 * 60, Now())
End Property
Public Property Get key() As String
You can’t perform that action at this time.