Skip to content

Instantly share code, notes, and snippets.


Josh Ribakoff joshribakoff

View GitHub Profile
View gist:5863458
/** @AfterScenario */
public function after($event)
if(4==$event->getResult()) {
View gist:5885687
require_once 'app/Mage.php';
$quote = Mage::getModel('sales/quote')
$product = Mage::getModel('catalog/product')->load(6); /* 6 => Some product ID */
joshribakoff / Module.php
Last active Dec 19, 2015
Assign widget to ZF2 layout with events
View Module.php
public function onBootstrap(MvcEvent $e)
/** add categories to sidebar on every request */
$e->getApplication()->getEventManager()->attach(MvcEvent::EVENT_RENDER, function() use($e) {
$sm = $e->getApplication()->getServiceManager();
/** Only add it if the layout actually has a left column */
View layouts.php
// in the config for any module, you can map routes to their appropriate layout
// A later module could override the previous configuration
joshribakoff / gist:6011592
Created Jul 16, 2013
Creates 100 Magento 'store views' for profiling
View gist:6011592
require_once 'app/Mage.php';
for($i = 101; $i <= 200; $i++) {
$websiteName = 'test'.$i;
$storeName = 'test'.$i;
View gist:6034235
View gist:6042738
#!/usr/bin/perl -w # camel code
use strict;
ATA,0, 0;");foreach(1..3)
{<DATA>;}my @camel1hump;my$camel;
my$Camel ;while( <DATA>){$_=sprintf("%-6
9s",$_);my@dromedary 1=split(//);if(defined($
_=<DATA>)){@camel1hum p=split(//);}while(@dromeda
View gist:6153282
package {'php':
ensure => present,
before => File['/etc/php.ini'],
file {'/etc/php.ini':
ensure => file,
package {'httpd':
joshribakoff / gist:6273876
Created Aug 19, 2013
Send a test email in Magento
View gist:6273876
require_once 'app/Mage.php';
/** @var Mage_Customer_Model_Customer */
$customer = Mage::getModel('customer/customer')->load($_GET['customer']);
echo 'finished';
joshribakoff / gist:6714685
Last active Dec 24, 2015
php configure line
View gist:6714685
sudo ./configure --prefix=/opt/php-5.4.19 --enable-mbstring --enable-soap --with-curl --with-mcrypt --with-gd --with-zlib --enable-zip --with-pcre-regex --with-mysql --with-pdo-mysql --with-mysqli --with-openssl --with-imap --with-imap-ssl --enable-fpm --with-kerberos
#compiling php5.3 gives error, work around with:
sed -i '/^BUILD_/ s/\$(CC)/\$(CXX)/g' Makefile
You can’t perform that action at this time.