Skip to content

Instantly share code, notes, and snippets.

View GirlBossRush's full-sized avatar
Building web apps with OpenAI!

Teffen Ellis GirlBossRush

Building web apps with OpenAI!
View GitHub Profile
###
Usage:
* add model.name property that will be used as a namespace in the json request
* put this code before your Backbone app code
* use toJSON() as usual (so there is no namespacing in your templates)
* your model's data will be sent under model.name key when calling save()
###
# save reference to Backbone.sync
Backbone.oldSync = Backbone.sync
@GirlBossRush
GirlBossRush / mr-file.js
Last active September 6, 2018 22:59 — forked from larsmqller/mr-file.js
function sendTrackEvent (eventData) {
window.ga('send', Object.assign({hitType: 'event'}, eventData);
}
function trackVideoEvents (videoElement) {
var $videoElement = $(videoElement);
var markers = [.1, .2, .3, .4, .5, .6, .7, .8, .9, 1];
var gaLoggingName = this.dataset.gaLoggingName;
var isTrackingProgress = false