Skip to content

Instantly share code, notes, and snippets.

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

Joseph Maxwell JosephMaxwell

🇺🇸
Working.
View GitHub Profile
@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)
{
@leventyalcin
leventyalcin / redis.
Created June 28, 2013 11:35
Running multiple instance of Redis on Centos. For understanding how add new instance look at first comment and if you want to what changed on init script with default you can check first and last revision of file.
#!/bin/sh
#
# redis init file for starting up the redis daemon
#
# chkconfig: - 20 80
# description: Starts and stops the redis daemon.
# Source function library.
. /etc/rc.d/init.d/functions
@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();
@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.