Skip to content

Instantly share code, notes, and snippets.

View raldred's full-sized avatar

Rob Aldred raldred

View GitHub Profile
<?php
$step_counter = 1;
$helper = Mage::helper('onestepcheckout/checkout');
?>
<?php if(!$this->canCheckout() || !$this->validateMinimumAmount()): ?>
<?php if($this->settings['checkout_title']): ?>
<h1 class="onestepcheckout-title"><?php echo $this->settings['checkout_title']; ?></h1>
<?php endif; ?>
- content_for :start_again do
- start_again order
%h1= t('checkout.payment.title')
-order_payment_errors_title(@order)
-order_errors_for(@order,:base)
.your_details
%h3 Your details
@raldred
raldred / subquery magic.sql
Created March 24, 2011 10:46
pre-preparing inner join results for faster querying and pivoting of data
create temporary table if not exists imports
(
year int(4),
country_id int(11),
value int(30),
INDEX `index_on_year_and_country_id` (year,country_id)
);
truncate imports;
insert into imports (
select year,country_id,sum(value)
@raldred
raldred / brew_install_imagemagick_output
Created September 12, 2011 09:21
Output of failure to compile imagemagick on OSX 10.6 with Xcode 3
==> Downloading https://github.com/trevor/ImageMagick/tarball/6.7.1-1
File already downloaded in /Users/robaldred/Library/Caches/Homebrew
/usr/bin/tar xf /Users/robaldred/Library/Caches/Homebrew/imagemagick-6.7.1-1.tgz
==> ./configure --disable-osx-universal-binary --without-perl --prefix=/usr/local/Cellar/imagemagick/6.7.1-1 --disable-dependency-tracking --enable-shared --disable-static --with-modules --without-gslib --with-gs-font-dir=/usr/local/share/ghostscript/fonts --without-magick-plus-plus
./configure --disable-osx-universal-binary --without-perl --prefix=/usr/local/Cellar/imagemagick/6.7.1-1 --disable-dependency-tracking --enable-shared --disable-static --with-modules --without-gslib --with-gs-font-dir=/usr/local/share/ghostscript/fonts --without-magick-plus-plus
configuring ImageMagick 6.7.1-1
checking build system type... x86_64-apple-darwin10.8.0
checking host system type... x86_64-apple-darwin10.8.0
checking target system type... x86_64-apple-darwin10.8.0
checking whether build environment is san
@raldred
raldred / homebrew doctor output
Created September 12, 2011 09:31
Doctor output
==> /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. This is an issue if you eg. brew installed Python.
Consider editing your .bashrc to put:
/usr/local/bin
ahead of /usr/bin in your $PATH.
You have a non-brew 'pkg-config' in your PATH:
/usr/bin/pkg-config
@raldred
raldred / scl.gemspec
Created October 28, 2011 13:37
Gemspec for SCL
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = "scl"
s.version = "0.0.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
@raldred
raldred / gist:1358611
Created November 11, 2011 17:25
adduser man page
ADDUSER(8) ADDUSER(8)
NAME
adduser, addgroup - add a user or group to the system
SYNOPSIS
adduser [options] [--home DIR] [--shell SHELL] [--no-create-home] [--uid ID] [--firstuid ID] [--lastuid ID] [--ingroup GROUP | --gid ID] [--disabled-password] [--dis‐
abled-login] [--gecos GECOS] [--add_extra_groups] [--encrypt-home] user
adduser --system [options] [--home DIR] [--shell SHELL] [--no-create-home] [--uid ID] [--group | --ingroup GROUP | --gid ID] [--disabled-password] [--disabled-login]
@raldred
raldred / gist:2344596
Created April 9, 2012 16:33
Draw Something libdvm error & stack
04-09 17:19:33.021: E/dalvikvm(31980): JNI ERROR (app bug): attempt to use stale global reference 0x400212 (should be 0x500212)
04-09 17:19:33.021: E/dalvikvm(31980): VM aborting
04-09 17:19:33.021: A/libc(31980): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1)
04-09 17:19:33.536: I/DEBUG(31893): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-09 17:19:33.536: I/DEBUG(31893): Build fingerprint: 'google/yakju/maguro:4.0.2/ICL53F/235179:user/release-keys'
04-09 17:19:33.536: I/DEBUG(31893): pid: 31980, tid: 31980 >>> com.omgpop.dstfree <<<
04-09 17:19:33.536: I/DEBUG(31893): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
04-09 17:19:33.536: I/DEBUG(31893): r0 00000000 r1 000a0aa8 r2 00000000 r3 00000000
04-09 17:19:33.536: I/DEBUG(31893): r4 deadd00d r5 40890c58 r6 0000020c r7 40824881
04-09 17:19:33.536: I/DEBUG(31893): r8 4086d304 r9 00400212 10 bebef630 fp 0000054c
@raldred
raldred / gist:4155079
Created November 27, 2012 16:02
Unique array combination generation
Compare.prototype.getCombinations = function(arr) {
var r = 2;
var pool = arr;
var n = pool.length;
if(r > n) {
return;
}
var indices = [0,1];
var res = [];
var tmp = [];
@raldred
raldred / gist:5780675
Created June 14, 2013 09:38
zavvi checkout broken on android chrome
["_trackEvent", "Checkout", "Payment Method", "new card"] main-1.0.86.js:20
["_trackEvent", "Checkout", "Payment Method", "delivery address used for billing address"] main-1.0.86.js:20
GET main-1.0.86.js:20
["_trackEvent", "Checkout", "Delivery Address", "PCA Find Address"] main-1.0.86.js:20
Post successful. main-1.0.86.js:20
Poll start. main-1.0.86.js:20
Resource interpreted as Script but transferred with MIME type text/html: "https://services.postcodeanywhere.co.uk/popups/inline.aspx?account_code=THE…tion=lookup&type=by_postcode&callback=pcaByPostcodeEndAH71&postcode=Sk25uw". main-1.0.86.js:6541
Done. main-1.0.86.js:20
["_trackEvent", "Checkout", "Standard Delivery", "1|Standard%20Delivery%20-%20%A30.00%A0%A0%A0"] main-1.0.86.js:20
200: Use the proper data. main-1.0.86.js:20