Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Mauck chrismauck

  • AbelsonTaylor, Inc
  • Chicago, IL
View GitHub Profile
@chrismauck
chrismauck / geo_dist.php
Created Aug 20, 2019
Calculate distance between points using lat and lon
View geo_dist.php
<?php
/*::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
/*:: :*/
/*:: This routine calculates the distance between two points (given the :*/
/*:: latitude/longitude of those points). It is being used to calculate :*/
/*:: the distance between two locations using GeoDataSource(TM) Products :*/
/*:: :*/
/*:: Definitions: :*/
/*:: South latitudes are negative, east longitudes are positive :*/
@chrismauck
chrismauck / cls.js
Created Apr 27, 2017
Modern browser version of https://github.com/chrismauck/cls-js; Helper functions for class manipulation
View cls.js
/*
* cls - helper functions for class manipulation
* https://github.com/chrismauck/cls-js
*
* cls.hasClass( elem, 'class-name' ) => boolean check
* cls.addClass( elem, 'class-name' ) => add class(es)
* cls.removeClass( elem, 'class-name' ) => remove class(es)
* cls.toggleClass( elem, 'class-name' ) => toggle class(es)
*/
View doubleclick_exit.js
/*
* addExit - Add DoubleClick exit
*
* @param {String | Array} el - id, or array of element ids to accept the event
* @param {String} evt - event to listen for
* @param {String} ext - name of the DoubleClick exit
* @param {String} alt - URL of DoubleClick exit override if exists
* Usage addExit.event('cta', 'click', 'Main Exit');
*/
var addExit = {
@chrismauck
chrismauck / veeva.js
Created Aug 30, 2016 — forked from pfeilbr/veeva.js
Veeva API helper library
View veeva.js
// Veeva API helper library
// dependencies: async
// Brian Pfeil - 2012-03-01 - init
(function() {
window.veeva = {
getRandomFunctionName: function() {
var randomNumber = Math.floor(Math.random() * (new Date()).getTime());
var millisecondsSinceEpoch = (new Date().getTime());
View hostReachable.js
function hostReachable() {
// Handle IE and more capable browsers
var xhr = new ( window.ActiveXObject || XMLHttpRequest )( "Microsoft.XMLHTTP" );
var status;
// Open new request as a HEAD to the root hostname with a random param to bust the cache
xhr.open( "HEAD", "//" + window.location.hostname + "/?rand=" + Math.floor((1 + Math.random()) * 0x10000), false );
// Issue request and handle response
@chrismauck
chrismauck / clickstream.js
Created Dec 14, 2015 — forked from michaeldegli/clickstream.js
Tracking time on slide with Veeva Clickstream object using JavaScript
View clickstream.js
//First thing: get the product SFID
function prod_callback(result) {
prod_id_array.push(result);
}
com.veeva.clm.getDataForCurrentObject("KeyMessage", "Product_vod__c", prod_callback);
function track(arr) {
You can’t perform that action at this time.