Skip to content

Instantly share code, notes, and snippets.

View brucemcpherson's full-sized avatar

bruce mcpherson brucemcpherson

View GitHub Profile
@brucemcpherson
brucemcpherson / deadDropping.vba
Last active August 29, 2015 13:56
some example functions for deaddrop scriptdb
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 / 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;
' 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 / 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
@brucemcpherson
brucemcpherson / rStuff.gs
Created August 14, 2012 17:04
Basic Implementation of r-melt for Google Apps Script
// included in mcpher library - GAS key MEQ3tE5y5_cTOAgUbUKSIAiz3TLx7pV4j
// ramblings.mcpher.com
/**
* performs a melt reshape
* @param {object|string} options describes the melt actions required as either js object or jSon string
* @return {cDataSet} The populated sheet as a cDataSet
*/
function reshapeMelt (options) {
// this is a very basic start at gas implementation of Hadley Wickhams melt(R)
@brucemcpherson
brucemcpherson / rstuff.vba
Created August 15, 2012 09:13
Basic Implementation of r-melt for Excel/VBA
Option Explicit
Public Function reshapeMelt(options As String) As cDataSet
' this is a very basic start at vba implementation of Hadley Wickhams melt(R)
' http://www.statmethods.net/management/reshape.html
Dim jArgs As cJobject, ds As cDataSet, cj As cJobject, _
R As Range, ws As Worksheet, dr As cDataRow, dsOut As cDataSet, _
dc As cCell, dsre As cDataSet
' sort out the options
@brucemcpherson
brucemcpherson / ukpostcodesrest.gs
Created August 16, 2012 12:26
rest Excel/GAS library entries for uk postcodes
You can download cDataSet.xlsm from
http://ramblings.mcpher.com/Home/excelquirks/json/rest
The Google Apps script version is here
https://docs.google.com/spreadsheet/ccc?key=0At2ExLh4POiZdFAzUElyTGNQLW90aEFKeHhJZDR1WWc
(requires in mcpher library - GAS key MEQ3tE5y5_cTOAgUbUKSIAiz3TLx7pV4j
- details at https://gist.github.com/3358690)
@brucemcpherson
brucemcpherson / neildegrassetyson.gs
Created August 17, 2012 11:44
Neil deGrasse Tyson quotes API: The Daily REST library entry for Excel and GAScript
You can download cDataSet.xlsm from
http://ramblings.mcpher.com/Home/excelquirks/json/rest
The Google Apps script version is here
https://docs.google.com/spreadsheet/ccc?key=0At2ExLh4POiZdFAzUElyTGNQLW90aEFKeHhJZDR1WWc
(requires in mcpher library - GAS key MEQ3tE5y5_cTOAgUbUKSIAiz3TLx7pV4j
- details at https://gist.github.com/3358690)
@brucemcpherson
brucemcpherson / manifest.xml
Created August 20, 2012 11:59
example manifest for gistThat
<gistThat info="this is a manifest for gistThat VBA code distribution - see ramblings.mcpher.com for details"><manifest description="r-melt implementation for VBA" contact="bruce@mcpher.com"><gists><item1 gistid="3357942" version="" filename="rstuff.vba" module="rstuff"/><item2 gistid="3357942" version="" filename="rstuffsheet.vba" module="rstuffSheet"/></gists></manifest></gistThat>
@brucemcpherson
brucemcpherson / usefulStuff.xml
Created August 21, 2012 17:10
useful modules manifest
<gistThat info="this is a manifest for gistThat VBA code distribution - see ramblings.mcpher.com for details"><manifest description="useful module" contact="bruce@mcpher.com"><gists><item1 gistid="3414346" version="" filename="" module="usefulStuff" type="module"/></gists></manifest></gistThat>