Skip to content

Instantly share code, notes, and snippets.


Wayne Roddy dubrod

  • MODX
  • Inverness, FL
View GitHub Profile
Created Feb 14, 2011
Using the new FQL (Facebook) we pull # of Likes of a company page, make it a %, and insert it into osCommerce for a Coupon Code.
// must have installed in your osCommerce
$fb_data = json_decode(file_get_contents(""), true);
// See - Once a user has granted your application the "manage_pages" permission, the "accounts" connection will yield an additional access_token property for every page administrated by the current user.
// used for debugging/install
// print "<pre>";
dubrod / Foursquare Mayor
Created Apr 13, 2011
A small script to show who is the Mayor of a Foursquare Venue on your site.
View Foursquare Mayor
//main function
function foursquare_spotter() {
//set SpotID and Oauth Token -
$spot_id = 311661; // just change this # to your venue # in the foursquare URL
$oauth_token = 123456789; // just change this # to your Oauth Token
if ($spot_id != "") {
dubrod / Gowalla Recent Activity Script
Created Apr 13, 2011
Show the 5 Recent Checkins with Name and Photo from your Gowalla Spot
View Gowalla Recent Activity Script
function nicetime($date)
if(empty($date)) {
return "No date provided";
$periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade");
$lengths = array("60","60","24","7","4.35","12","10");
View Facebook Feed Trim
function facebook_feed() {
$token = "XXXXXX";
$fb_id = "XXXXXX"; // the number in your Facebook URL
$json = json_decode(file_get_contents("$fb_id/feed?access_token=$token"), true);
// only grab 1st
Created Aug 30, 2011
Translate # of Twitter Followers to Discount Coupon % on osCommerce
$tweet_data = json_decode(file_get_contents(""), true);
// display tweet data array ( just to show you i know what i'm doing =] )
//print "<pre>";
//print "</pre>";
dubrod / 2013 Adaptive CSS Containers
Last active Dec 15, 2018
2013 Adaptive CSS Containers Snippet. From 1600+ to Mobile. This snippet will keep a nice margin on the sides of your container for browser size most used in 2012. It's not a Responsive Snippet, that would be using %.
View 2013 Adaptive CSS Containers
/*~~~~ CONTAINERS December 2013 - ~~~~*/
/* 1600x900 4.09% */
margin: 0 auto;
width:1410px; /* 3 Columns would be 470px */
/* 1440x900 5.26% */
@media (max-width: 1440px){ .container{width: 1230px; /* 3 Columns would be 410px */ } }
dubrod / SADO API
Created Jan 8, 2013
Setting Up and API in PHP for those of us awesome developers using SADO.
require_once 'lib/Sado/sado.bootstrap.php';
dubrod / MODX Nav Switch
Last active Dec 13, 2015
Switch MODX Nav from <ul> to <select> when mobile device detected.
View MODX Nav Switch
Change Nav UL to Select when Mobile.
System Settings: Turn off resource and snippet caching. cacheable default is none. no pages can be cached.
1. add mobile_device_detect.php to the root folder
2. make sure jquery is called at the top of every page
dubrod / Mobile Device Detect
Last active May 12, 2016
A simple mobile device detector in PHP . If $mobile_browser == true ....
View Mobile Device Detect
$mobile_browser = false; // set mobile browser as false till we can prove otherwise
$user_agent = $_SERVER['HTTP_USER_AGENT']; // get the user agent value - this should be cleaned to ensure no nefarious input gets executed
$accept = $_SERVER['HTTP_ACCEPT']; // get the content accept value - this should be cleaned to ensure no nefarious input gets executed
switch(true){ // using a switch against the following statements which could return true is more efficient than the previous method of using if statements
case (preg_match('/ipad/i',$user_agent)); // we find the word ipad in the user agent
$mobile_browser = false; // mobile browser is either true or false depending on the setting of ipad when calling the function
$status = 'Apple iPad';
dubrod / gist:5488995
Created Apr 30, 2013
Prototype slider js file. Used in Magento 1.7 - Based on - BUT I changed line 20 duration to 0 so you don't have that stack issue
View gist:5488995
// set the starting image.
var i = 0;
// The array of div names which will hold the images.
var image_slide = new Array('image-1', 'image-2', 'image-3');
// The number of images in the array.
var NumOfImages = image_slide.length;
You can’t perform that action at this time.