Skip to content

Instantly share code, notes, and snippets.

View davidjturnbull's full-sized avatar

David Turnbull davidjturnbull

View GitHub Profile
@davidjturnbull
davidjturnbull / convert_duration.py
Created September 7, 2016 07:59
Zapier code - Convert Resource Guru booking 'duration' value into seperate 'hours' and 'minutes' values
duration = int(input['duration'])
# calculate the hours
divided_hours = duration / 60
# calculate the minutes remaining
minutes_remaining = duration % 60
return {'hours': divided_hours, 'minutes' : minutes_remaining }
@davidjturnbull
davidjturnbull / gist:ef1a76528b1ac65d4f9b
Created November 4, 2015 15:54
Segment.com - Track: Downloaded File
// Download Link
<a href="http://[FILE PATH GOES HERE eg: mydownload.pdf]" id="filedownload" target="_blank"><em>“My Download</em>”</a>
// File Download Tracking
<script type="text/javascript">
var link = document.getElementById('filedownload');
analytics.trackLink(link, 'Downloaded File', {
getReferrerTraits = function() {
// Requires: jQuery, jQuery.cookie, segment.io
// TODO: Update referralHost:blackList with your domain, so we only track external referrers.
var analytics_args = [],
analytics_traits,
acquisitionSource,
firstReferrer,
firstCampaign,

Keybase proof

I hereby claim:

  • I am daveturnbull on github.
  • I am davidturnbull (https://keybase.io/davidturnbull) on keybase.
  • I have a public key whose fingerprint is 3403 A625 666B 0AFD 496A 573C B732 73D5 4E17 DECC

To claim this, I am signing this object: