This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let endpoint = `https://dm3.mixpanel.org/refreshDungeon` | |
let auth = `Bearer ${inputData.token}` | |
let dungeon = inputData.dungeon | |
let opts = { | |
method: "POST", | |
body: dungeon, | |
headers: { | |
"Content-Type" : "application/json", | |
"Authorization" : auth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GitHub to Mixpanel Annotations | |
// by AK | |
// ak@mixpanel.com | |
// purpose: ingest github webhooks; create Mixpanel annotations | |
//deps | |
const crypto = require('crypto'); | |
const http = require("https"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// written for google's app script inside google sheets | |
// https://developers.google.com/apps-script/guides/sheets | |
function syncLookupTable() { | |
console.log('syncing lookup table!') | |
//credentials | |
const credentials = { | |
groupKey : `{{ your group key for existing lookup table }}`, | |
serviceAcct: `{{ service acct username }}`, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
//https://gist.github.com/5d8697db0dffc3bb76419cabc75bd376 | |
//vital LFO generator | |
//points are 2x num_point | |
//points are between 0 and 1 | |
//powers are same as num_point | |
//powers are between -20 and 20 | |
/* beautify ignore:start */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//PUT YOUR MIXPANEL TOKEN AND SECRET BELOW: | |
const credentials = { | |
"token": "your-mixpanel-token-here", | |
"secret": "your-mixpanel-secret-here" | |
} | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//a vanilla implementation of .track() | |
//docs: https://developer.mixpanel.com/docs/http | |
//by AK | |
function trackStuff(uuid, eventName, props, token) { | |
//the mixpanel data model | |
let spec = { | |
"event": eventName, | |
"properties": { | |
// these two properties are required! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//an example of Mixpanel implemented in a frameworkless SPA | |
//docs: https://developer.mixpanel.com/docs/javascript | |
//by AK | |
const app = { | |
init: function() { | |
console.log("app init!"); | |
this.cacheDOM(); | |
this.bindEvents(); | |
this.authUser().then((user) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
04875712bf99ebf077b759b3a06b370be4929115e7eb14737e87a91bc7a7542f6647010bfb99d52c788299ff6100c61eb98b731ea05482f44a9387f3206f1e8cae;jasonseiler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
//initialize everyone as an unknown user | |
mixpanel.register({"known-user":false}); | |
//build a list of properties to send with the page View event | |
var pageProps = {"page name":$(document).attr('title')} | |
//sends the page load event; a response of 1 on the XHR request means mixpanel got the data | |
mixpanel.track('Page View', pageProps) | |
}) |
NewerOlder