Skip to content

Instantly share code, notes, and snippets.

View dongilbert's full-sized avatar
😍
Mautic WOOOO

Don Gilbert dongilbert

😍
Mautic WOOOO
View GitHub Profile
@dongilbert
dongilbert / .profile
Created November 15, 2013 22:06
PHP Quick Switching I've linked up the libphp5.so to a symlinked version in `~/.phpenv/` and also linked up the current version's `bin` folder.
alias php53='brew unlink php53 > /dev/null; brew unlink php54 > /dev/null; brew unlink php55 > /dev/null; brew link php53 > /dev/null; ln -sf /usr/local/Cellar/php53/5.3.26/libexec/apache2/libphp5.so /Users/admin/.phpenv/libphp5.so; ln -sf /usr/local/Cellar/php54/5.3.26/bin /Users/admin/.phpenv/bin; sudo apachectl restart; echo "PHP 5.3 Enabled";'
alias php54='brew unlink php53 > /dev/null; brew unlink php54 > /dev/null; brew unlink php55 > /dev/null; brew link php54 > /dev/null; ln -sf /usr/local/Cellar/php54/5.4.19/libexec/apache2/libphp5.so /Users/admin/.phpenv/libphp5.so; ln -sf /usr/local/Cellar/php54/5.4.19/bin /Users/admin/.phpenv/bin; sudo apachectl restart; echo "PHP 5.4 Enabled";'
alias php55='brew unlink php53 > /dev/null; brew unlink php54 > /dev/null; brew unlink php55 > /dev/null; brew link php55 > /dev/null; ln -sf /usr/local/Cellar/php55/5.5.3/libexec/apache2/libphp5.so /Users/admin/.phpenv/libphp5.so; ln -sf /usr/local/Cellar/php54/5.5.3/bin /Users/admin/.phpenv/bin; sudo apachectl restart; e
@dongilbert
dongilbert / lead_controller.php
Created December 3, 2012 15:00
Joomla Export to CSV
<?php
/**
* @version 1.0.0
* @package com_stats
* @copyright Copyright (C) 2012. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access.
defined('_JEXEC') or die;
@dongilbert
dongilbert / wp-shell-install.sh
Created May 2, 2011 15:27
Auto Install Latest WordPress from Shell
#!/bin/bash
# Install script for Latest WordPress by Johnathan Williamson - extended by Don Gilbert
# Disclaimer: It might not bloody work
# Disclaimer 2: I'm not responsible for any screwups ... :)
# DB Variables
echo "MySQL Host:"
read mysqlhost
export mysqlhost
@dongilbert
dongilbert / config.php
Created August 2, 2012 14:18
Override Core Joomla! Classes
<?php
/**
* @package Joomla.Plugin
* @subpackage System.Overrides
*
* @copyright Copyright (C) 2012 Don Gilbert. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
define('OVERRIDES', dirname(__FILE__).'/overrides');
@dongilbert
dongilbert / sms-alerts.php
Created April 18, 2012 14:15
Send SMS Alerts via PHP
<?php
// Get the POST data, if you are sending SMS as a response to a form.
$form = $_POST['form'];
// Insert your message here. Pull some results from $form or do whatever.
$message = 'Message Here.';
$subject = 'Whatever';
$to = array(
'Sprint' => 'phonenumber@messaging.sprintpcs.com',
@dongilbert
dongilbert / geocode.php
Created May 10, 2014 16:11
Geocode an address, passed as array params
<?php
/**
* Geocode an address.
*
* @param mixed $params Array containing address info or string address.
*
* @return array Array of longitude or latitude data.
*/
function getLatLng($params)
{
@dongilbert
dongilbert / formmod.php
Created May 7, 2014 17:17
System plugin to modify form inputs.
<?php
/**
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
class plgSystemFormmod extends JPlugin
{
@dongilbert
dongilbert / namespace.php
Last active May 12, 2019 11:25
Joomla Namespace Compatibility Layer
<?php
return array(
'JAccess' => 'Joomla\\Access\\Access',
'JAccessRule' => 'Joomla\\Access\\Rule',
'JAccessRules' => 'Joomla\\Access\\Rules',
'JApplicationBase' => 'Joomla\\Application\\Base',
'JApplicationCli' => 'Joomla\\Application\\Cli',
'JApplicationDaemon' => 'Joomla\\Application\\Daemon',
'JRoute' => 'Joomla\\Application\\Route',
@dongilbert
dongilbert / modellegacy.php
Last active October 27, 2018 18:04
Joomla getName() method to strip format from returned view name.
<?php
class JModelLegacy
{
/**
* Method to get the view name
*
* The view name by default parsed using the classname, or it can be set
* by passing a $config['name'] in the class constructor
*
@dongilbert
dongilbert / git-wordpress.txt
Created April 27, 2012 14:27
Use Git with WordPress Plugin Development
=== Using Git with WordPress Plugin Development ===
git svn clone -s -r<rev-number> https://svn.wp-plugins.org/<plugin-path> <-- Clone the plugin repo
cd <plugin-path> <-- change to directory
git svn fetch <-- Pull svn history
git remote add -f github git@github.com:<github-url> <-- add github remote
/* ADD CODE */ <-- write code
git add * <-- add to git
git commit -m "Starting to code" <-- commit changes
git svn dcommit <-- push to svn
git push -f github <-- push to github