Skip to content

Instantly share code, notes, and snippets.

Avatar

bruce mcpherson brucemcpherson

View GitHub Profile
@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 / 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;
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 / 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
@brucemcpherson
brucemcpherson / rStuff.gs
Created Aug 14, 2012
Basic Implementation of r-melt for Google Apps Script
View rStuff.gs
// 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 Aug 15, 2012
Basic Implementation of r-melt for Excel/VBA
View rstuff.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 Aug 16, 2012
rest Excel/GAS library entries for uk postcodes
View ukpostcodesrest.gs
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 Aug 17, 2012
Neil deGrasse Tyson quotes API: The Daily REST library entry for Excel and GAScript
View neildegrassetyson.gs
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 Aug 20, 2012
example manifest for gistThat
View manifest.xml
<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 Aug 21, 2012
useful modules manifest
View usefulStuff.xml
<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>