Skip to content

Instantly share code, notes, and snippets.

David Levy davidlevy

Block or report user

Report or block davidlevy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davidlevy
davidlevy / xiti_tag_prototype.js
Last active Aug 29, 2015
XITI Prototype integration
View xiti_tag_prototype.js
vpTrackClick = function(tag, element) {
return xt_click(element,'C', xtn2, tag,'N');
}
vpAttachClickTag = function(col, tag) {
col.each( function(element){
$(element).observe('click', function(e) {
if (element.tagName=='A') {
e.preventDefault();
return vpTrackClick(tag, element);
} else if (element.tagName=='INPUT' && element.type=="submit") {
@davidlevy
davidlevy / convertGeoToPixel.php
Created Jul 1, 2013
Function to convert Geo coordinates To Pixels
View convertGeoToPixel.php
<?php
function convertGeoToPixel($lat, $lon){
$mapWidth = 400;
$mapHeight = 260;
$mapLonLeft = -180;
$mapLonRight = 180;
$mapLonDelta = $mapLonRight - $mapLonLeft;
@davidlevy
davidlevy / interactionCounts.php
Last active Dec 18, 2015
Get values for Schema.org interactionCount properties
View interactionCounts.php
/*
Example :
<?php $url = 'http' . ($_SERVER['HTTPS'] ? 's':'') .'://'.$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; ?>
<meta itemprop="interactionCount" content="UserTweets:<?php echo get_tweets($url);?>"/>
*/
function get_tweets($url) {
$url = urlencode($url);
You can’t perform that action at this time.