Skip to content

Instantly share code, notes, and snippets.

@timhall
timhall / .block
Last active September 29, 2016 15:50
d3.compose Heatmap
license: mit
Private Client As WebClient
Private Wrapper As WebAsyncWrapper
Private AllRequests As Collection
Private BatchIndex As Long
Private BatchSize As Long
Private Waiting As Long
Public Sub ExecuteRequests()
Dim i As Long
Dim Request As WebRequest
@timhall
timhall / .block
Last active September 29, 2016 14:42
d3.compose Tooltip
license: mit
@timhall
timhall / .block
Last active September 29, 2016 14:45
d3.compose Error Bars
license: mit
/*
Goal:
Draw charts and components purely from selection and props
Question:
Is it more performant (speed and memory):
a) transform data fully before passing to draw
b) transform data minimally and prepare (d, i) functions and pass with props
Hypothesis:
@timhall
timhall / d3.compose functional.md
Last active November 18, 2015 15:23
d3.compose functional

Goals

Apply functional techniques to make d3.compose easier to reason about, more testable, and better match d3's standard approach

Implementation

Use a "smart"/"dumb" components approach (reference) with "smart" component handling logic, state, and context and "dumb" component handling rendering.

  • The "dumb" component is stateless and is a simple, idempotent function that takes in a d3.selection and properties and renders the chart.
  • The "smart" component provides the API for interacting with Compose, prepares properties for the "dumb" component, and handles any logic/state
''
' Todoist Authenticator
' (c) Tim Hall - https://github.com/VBA-tools/VBA-Web
'
' Custom IWebAuthenticator for TODOist API
' https://developer.todoist.com/#oauth
' ```
'
' @class TodoistAuthenticator
' @implements IWebAuthenticator v4.*
''
' Xing Authenticator
'' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '
Implements IWebAuthenticator
Option Explicit
' --------------------------------------------- '
' Constants and Private Variables
' --------------------------------------------- '
@timhall
timhall / Crunchbase.bas
Created February 13, 2015 01:12
Crunchbase VBA-Web Example
Private Const UserKey As String = "YOUR-USER-KEY"
Private pClient As WebClient
Public Property Get Client() As WebClient
If pClient Is Nothing Then
Set pClient = New WebClient
pClient.BaseUrl = "https://api.crunchbase.com/v/2/"
End If
Set Client = pClient
@timhall
timhall / gist:2734e7d858a7d8c54360
Last active March 8, 2024 20:19
VBA-Web - Google Calendar API
' (Based of Analytics example)
' In Client setup, set BaseUrl and Scope for Calendar
Client.BaseUrl = "https://www.googleapis.com/calendar/v3/"
Auth.AddScope "calendar"
Public Type CalendarEvent
Summary As String
Location As String
Attendees As Collection
StartTime As Date