Skip to content

Instantly share code, notes, and snippets.

View kohiomobz's full-sized avatar

Kavodel kohiomobz

View GitHub Profile
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="https://cdn.mxpnl.com/libs/mixpanel-platform/css/reset.css">
<link rel="stylesheet" type="text/css" href="https://cdn.mxpnl.com/libs/mixpanel-platform/build/mixpanel-platform.v0.latest.min.css">
<script src="https://cdn.mxpnl.com/libs/mixpanel-platform/build/mixpanel-platform.v0.latest.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script>
<style>
.node circle {
@kohiomobz
kohiomobz / gist:e3a9324f91caba60719a
Last active October 7, 2015 19:03
Mixpanel: Track Links Workaround
<div id=“example-link”></div>
$(“#example-link”).click(function(event){
var redirectFunction = callback($(this));
event.preventDefault();
mixpanel.track(“Link Clicked”);
setTimeout(redirectFunction, 300);
});
function callback(val) {
@kohiomobz
kohiomobz / gist:7598c0df81582f5ff4cc
Last active August 9, 2016 06:42
Keeping Production Data Clear
var productionHost = 'Your production Domain'; /* www.mixpanel.com */
var devToken = 'Development Token';
var prodToken = 'Production Token';
/* If the hostname is anything other than your production domain, initialize the Mixpanel library with your Development Token */
if (window.location.hostname.toLowerCase().search(productionHost) < 0) {
@kohiomobz
kohiomobz / robot.js
Created December 7, 2012 18:30
KevinScript
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);