Skip to content

Instantly share code, notes, and snippets.

@ashleydw
ashleydw / magento_add_to_customer_cart.php
Created July 24, 2014 13:12
Magento finding a product and options based on an arbitory string
$_varien = new Varien_Object(array_merge(array(
'product' => $product->getId(),
'qty' => 1,
), $optionsToUse));
/** @var Mage_Customer_Model_Customer $_customer */
foreach ($filters['customers'] as $_customer) {
/**
* try to find a cart for the customer
@ashleydw
ashleydw / nginx.conf
Last active December 31, 2025 11:43
Laravel nginx conf file
server {
listen 80 default_server;
server_name example.com www.example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public;
index index.php index.html;
@ashleydw
ashleydw / gist:66fbd08de27bd5663634
Created December 12, 2014 09:36
vagrant_devstack_chef_error
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'osi'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: osi
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
default: Adapter 3: hostonly
@ashleydw
ashleydw / screenshot.php
Last active August 29, 2015 14:17
Capture screenshots using Event Firing Webdriver
<?php
$webdriver = new EventFiringWebDriver(
RemoteWebDriver::create(
'http://localhost:9515',
DesiredCapabilities::phantomjs()
)
);
$webdriver->getDispatcher()->register(new SeleniumEventListener());
@ashleydw
ashleydw / gist:a717be3bff10f517f43a
Created April 14, 2015 13:53
reapp build errors
reapp build
Building...
Building with webpack...
Had errors:
./~/reapp-kit/dist/index.js
Module not found: Error: Cannot resolve module 'reapp-ui/all' in /Users/ashley/Sites/MobileReapp/ReappTest/node_modules/reapp-kit/dist
resolve module reapp-ui/all in /Users/ashley/Sites/MobileReapp/ReappTest/node_modules/reapp-kit/dist
looking for modules in /Users/ashley/Sites/MobileReapp/ReappTest
/Users/ashley/Sites/MobileReapp/ReappTest/reapp-ui doesn't exist (module as directory)