Skip to content

Instantly share code, notes, and snippets.

View alistairstead's full-sized avatar

Alistair Stead alistairstead

View GitHub Profile
<?php
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = Mage::getModel('catalog/product')->getResource()->getTypeId();
$setup->addAttribute($orderEntityTypeId, 'remove_from_back_order', array(
'group' => 'Fulfillment API',
'label' => 'Remove from back order upon fullfiller API update',
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./TestHelper.php"
colors="true"
backupGlobals="false"
backupStaticAttributes="false"
convertErrorsToExceptions="false"
convertNoticesToExceptions="false"
convertWarningsToExceptions="false"
processIsolation="false"
stopOnFailure="true"
[xdebug]
xdebug.profiler_enable_trigger=on
xdebug.remote_autostart=off
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.idekey=ECLIPSE_XDEBUG
xdebug.collect_vars=on
xdebug.collect_params=4
@alistairstead
alistairstead / xdebug.ini
Created February 18, 2011 10:50
xDebug INI settings for use with MacGDBp and TextMate
[xdebug]
zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.cli_color = 1
; xdebug.scream = 1
[xdebug-remote-debug]
; xdebug.remote_enable = On
; xdebug.remote_autostart = 1
; xdebug.remote_mode = jit
; xdebug.remote_connect_back = 1
@alistairstead
alistairstead / Build output
Created May 13, 2011 10:29
Build with veewee
~/vagrant
→ vagrant basebox build ubuntu-10.10-amd64
Verifying the isofile ubuntu-10.10-server-amd64-netboot.iso is ok.
We found no good state so we are destroying the previous machine+disks
VBoxManage unregistervm 'ubuntu-10.10-amd64' --delete
Deleting vm ubuntu-10.10-amd64
Creating vm ubuntu-10.10-amd64 : 256M - 1 CPU - Ubuntu_64
Creating new harddrive of size 10140
VBoxManage createhd --filename '/Users/ali/VirtualBox VMs/ubuntu-10.10-amd64/ubuntu-10.10-amd64.vdi' --size '10140' --format vdi > /dev/null
@alistairstead
alistairstead / gist:1053331
Created June 29, 2011 07:36
Find bad things in Magento customisations
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getModel("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getResourceModel("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getSingleton("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "SELECT.*FROM.*;[\"\']"
find . -name "*.php" -print | xargs grep --color=auto -iRnH "htmlEscape("
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "htmlEscape("
find ./app/code/local -name "*/Block/*.phtml" -print | xargs grep --color=auto -iRnH "SELECT.*FROM.*;[\"\']"
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "\$_[GET|REQUEST|SERVER|POST]"
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "public _construct"
find . -name "*.php" -print | xargs grep --color=auto -iRnH "public _construct"
<!DOCTYPE html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Node-1</title>
<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
<link rel="stylesheet" href="http://yuilibrary.com/yui/docs/assets/node/node.css">
</head>
<body>
<form id="demo" action="#">
@alistairstead
alistairstead / gist:2351965
Created April 10, 2012 14:55
Spinner.html
<!DOCTYPE html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Widget</title>
<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
<link rel="stylesheet" href="http://yuilibrary.com/yui/docs/assets/node/node.css">
<style type="text/css" scoped>
.yui3-js-enabled .yui3-spinner-loading {
display:none;
}
@alistairstead
alistairstead / deploy.rb
Created September 25, 2012 14:21
magentify with silverstripe config
set :application, "set your application name here"
set :domain, "#{application}.com"
set :deploy_to, "/Users/ali/magento"
set :use_sudo, false
set :scm, :none
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, `subversion` or `none`
role :web, "localhost" # Your HTTP server, Apache/etc
@alistairstead
alistairstead / local.xml
Created November 1, 2014 12:09
Disable the automatic application of update scripts on each page request following cache clear. Use MageRun to apply the upgrades manually within a controlled step.
<?xml version="1.0"?>
<config>
<global>
<skip_process_modules_updates>1</skip_process_modules_updates>
</global>
</config>