Skip to content

Instantly share code, notes, and snippets.

🖥
Virtualizing virtuals

Michael Babker mbabker

🖥
Virtualizing virtuals
Block or report user

Report or block mbabker

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
@mbabker
mbabker / # php@7.2 - 2019-07-02_12-35-57.txt
Created Jul 2, 2019
php@7.2 on macOS 10.13.6 - Homebrew build logs
View # php@7.2 - 2019-07-02_12-35-57.txt
Homebrew build logs for php@7.2 on macOS 10.13.6
Build date: 2019-07-02 12:35:57
@mbabker
mbabker / notes.md
Last active Jul 21, 2016
Joomla! Prepared Statement Support
View notes.md

Joomla developers! Your support is needed to help make prepared statements in Joomla's database API a reality. I've started on some of this work but need help with testing and review.

Joomla's PDO driver already has provisions for prepared statement support written into it and the unsupported Oracle and SQLite drivers already make use of this.

In the Joomla! Framework Database Package I've started on work to expand this support. First, the PDO MySQL driver now has bound variable support and will fully support prepared statements.

I've opened pull requests for the MySQLi and PostgreSQL drivers to add support for prepared statements using the already defined interfaces in Joomla's database layer. Also, there is [a pull request](https://github.com/joomla

View keybase.md

Keybase proof

I hereby claim:

  • I am mbabker on github.
  • I am mbabker (https://keybase.io/mbabker) on keybase.
  • I have a public key whose fingerprint is EED9 6707 E398 8018 9C02 A87D 00E1 51E3 933D B00B

To claim this, I am signing this object:

@mbabker
mbabker / existing.php
Created Jun 13, 2015
getInstance Comparision
View existing.php
public static function getInstance($options = array())
{
// Sanitize the database connector options.
$options['driver'] = (isset($options['driver'])) ? preg_replace('/[^A-Z0-9_\.-]/i', '', $options['driver']) : 'mysqli';
$options['database'] = (isset($options['database'])) ? $options['database'] : null;
$options['select'] = (isset($options['select'])) ? $options['select'] : true;
// If the selected driver is `mysql` and we are on PHP 7 or greater, switch to the `mysqli` driver.
if ($options['driver'] === 'mysql' && PHP_MAJOR_VERSION >= 7)
{
@mbabker
mbabker / podmanBatchSave.php
Created Dec 30, 2014
Podcast Manager Batch Resave Script
View podmanBatchSave.php
<?php
/**
* Podcast Manager Batch Save Script
*
* @copyright Copyright (C) 2014 Michael Babker. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License Version 2 or Later
*/
// Set flag that this is a parent file.
const _JEXEC = 1;
View Factory.php
<?php
/**
* Application powering http://michaels.website
*
* @copyright Copyright (C) 2014 Michael Babker. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License Version 2 or Later
*/
namespace BabDev\Website;
View AbstractHtmlView.php
<?php
/**
* Joomla! Framework Status Application
*
* @copyright Copyright (C) 2014 Open Source Matters, Inc. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License Version 2 or Later
*/
namespace Joomla\Status\View;
@mbabker
mbabker / wtf.php
Created Jul 8, 2014
You can't make this up...
View wtf.php
// Instead of a simple call to JHtml::_('behavior.framework') I have to deal with this...
if (JVERSION >= '1.6.0') {
$file = JUri::root() . '/media/system/js/core.js';
$loaded = false;
foreach ($document->_scripts as $key => $value) {
if ($key == $file) {
$loaded = true;
}
@mbabker
mbabker / moduleSave.php
Created Apr 29, 2014
CLI Script to resave all modules
View moduleSave.php
<?php
/**
* Module Resave Script
*
* @copyright Copyright (C) 2014 Michael Babker. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License Version 2 or Later
*/
// Set flag that this is a parent file.
const _JEXEC = 1;
@mbabker
mbabker / passwordReset.php
Last active Aug 29, 2015
This CLI script enables site administrators to require their site users to reset their password if they have not done so within a specified number of days
View passwordReset.php
<?php
/**
* Password Reset Script
*
* This command line script can be run as a cron job or on user request to flag user accounts on a site
* as requiring their passwords reset. This script flags all users who have not reset their passwords
* in the number of days specified by the user and compares to the lastResetTime column in the #__users
* table.
*
* The number of days can be specified in one of two manners:
You can’t perform that action at this time.