Skip to content

Instantly share code, notes, and snippets.

View jperona's full-sized avatar

John Perona jperona

View GitHub Profile
@jperona
jperona / wptoslxlead.php
Created November 29, 2012 22:38
SalesLogix WordPress to Lead - Test Post
function submit_form($post, $options) {
global $wp_version;
if (!isset($options['sdata_url']) || empty($options['sdata_url']))
return false;
//spam honeypot
if( !empty($_POST['message']) )
return false;
@jperona
jperona / BrowserDetection.js
Created November 15, 2012 00:37
Browser Detection
navigator.sayswho= (function(){
var N= navigator.appName, ua= navigator.userAgent, tem;
var M= ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
M= M? [M[1], M[2]]: [N, navigator.appVersion, '-?'];
return M;
})();