Skip to content

Instantly share code, notes, and snippets.


Wayne Roddy dubrod

  • MODX
  • Inverness, FL
View GitHub Profile
dubrod / zap-banner-engine
Last active Aug 29, 2015
Zap Banner Engine
View zap-banner-engine
//ZAP Banner Engine
$ZAP_banner_engine = new ZAP_banner_engine;
$banner_html = $ZAP_banner_engine->get_unseen();
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
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 / gist:3e6276350bd5ee27f232
Created Dec 14, 2015
Firebase DB to Static File for React JS
View gist:3e6276350bd5ee27f232
// first you have included your FireBase client JS
var leaguesNode = new Firebase("");
jsonLeagues = '{"leagues": []}';
leaguesNode.once("value", function(snapshot) {
snapshot.forEach(function(childSnapshot) {
var key = childSnapshot.key();
var val = childSnapshot.val();
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;
dubrod / Magento Advanced Import Dataflow SQL Database
Last active Dec 17, 2015
Here I have exported my Magento Advanced Import Dataflow Empty SQL Database. I wrote a PHP application to take values from various sources to create this master sheet. I then exported as csv and imported with no problems using the System->Import->Advanced Dataflows inside Magento
View Magento Advanced Import Dataflow SQL Database
CREATE TABLE `master` (
`mst_id` int(100) NOT NULL AUTO_INCREMENT,
`store` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`websites` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`attribute_set` varchar(75) COLLATE utf8_unicode_ci NOT NULL,
`type` varchar(75) COLLATE utf8_unicode_ci NOT NULL,
`category_ids` int(50) NOT NULL,
`sku` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`has_options` int(50) NOT NULL,
`name` varchar(300) COLLATE utf8_unicode_ci NOT NULL,
dubrod / Magento Custom XML Sitemap Creator
Created May 15, 2013
Get Collections for products, categories, and pages. Filter them, use any custom PHP you like and create an XML file. Couldn't find it so I built it. Very useful for carts that only have configurable "main" products and don't want all the bits and pieces "simple products" showing in the sitemap. 1. create a my_sitemap.xml to be overwritten. 2. K…
View Magento Custom XML Sitemap Creator
/* Compilation includes configuration file */
define('MAGENTO_ROOT', getcwd());
$compilerConfig = MAGENTO_ROOT . '/includes/config.php';
if (file_exists($compilerConfig)) {
include $compilerConfig;
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
You can’t perform that action at this time.