Skip to content

Instantly share code, notes, and snippets.

View JosephMaxwell's full-sized avatar
🇺🇸
Working.

Joseph Maxwell JosephMaxwell

🇺🇸
Working.
View GitHub Profile
@adamesque
adamesque / preloader.js
Created February 16, 2011 23:38
Uses jQuery's new Deferred object to help with image loading
/**
* Helper function for passing arrays of promises to $.when
*/
jQuery.whenArray = function ( array ) {
return jQuery.when.apply( this, array );
};
/**
* Accepts a single image src or an array of image srcs.
@goldsky
goldsky / transformKeys.php
Created August 16, 2012 18:36
Convert under_score type array's keys to camelCase type array's keys and likewise
<?php
/**
* Convert under_score type array's keys to camelCase type array's keys
* @param array $array array to convert
* @param array $arrayHolder parent array holder for recursive array
* @return array camelCase array
*/
public function camelCaseKeys($array, $arrayHolder = array()) {
$camelCaseArray = !empty($arrayHolder) ? $arrayHolder : array();
@Vinai
Vinai / Magento_IntegrationTest_Config.php
Last active October 18, 2016 17:16
Simple Magento 1 bootstrap for PHPUnit.
<?php
class Magento_IntegrationTest_Config extends Mage_Core_Model_Config
{
private $modelTestDoubles = [];
private $resourceModelTestDoubles = [];
public function setModelTestDouble($modelClass, $testDouble)
{