Skip to content

Instantly share code, notes, and snippets.

date type title slug
2013-08-28T13:51:35.000Z
post
Magento on Heroku - Part 1
/blog/magento-on-heroku-part-1

Heroku is an application platform that's widely used in the Ruby on Rails community. It's not as well known in the PHP world, but you can deploy and run PHP5 web applications on Heroku. It does take a bit more setup than Ruby/Python etc, but it's well worth the effort.

I've been using it recently to do some Magento development - here's the steps to get up and running with Magento on Heroku.

type Query {
products: [Product]
stores: [Store]
}
type Product {
id: ID!
name: String!
price: Int!
related: [Product]
const resolvers = {
// Resolvers can fetch data for fields on the query root. As long as they return
// data that matches the schema, this can come from anywhere. Here we've hardcoded
// some data.
Query: {
products: () => [
{
name: 'Eggs',
price: 199
}
@cgrice
cgrice / gist:3760558
Created September 21, 2012 09:22
Greplace
grep -lre 'STRTOREPLACE' ./ | xargs sed -i "" 's/STRTOREPLACE/REPLACEMENT/g'
def get_ASIN(self, ean_13):
# Set request URL and URL params
base_url = "http://ecs.amazonaws.com/onca/xml"
url_params = dict(
Service='AWSECommerceService',
Operation='ItemLookup',
IdType='EAN',
ItemId=ean_13,
SearchIndex='Music',
AWSAccessKeyId=AWS_ACCESS_KEY_ID,
if __name__ == '__main__':
droid = android.Android()
# Scan a CD barcode
barcode = droid.scanBarcode()
droid.makeToast('Fetching product info')
EAN = barcode['result']['SCAN_RESULT']
Scanner = RIAAScanner()
# Convert EAN-13 barcode to Amazon ASIN
ASIN = Scanner.get_ASIN(EAN)
droid.makeToast('Scanned: '+Scanner.title+' - '+Scanner.artist)
"""Scan a barcode from a CD/Album, and determine if it was released by a member of the RIAA"""
__author__ = 'Chris Grice <[email protected]>'
__license__ = 'MIT Licence'
import android
import urllib
import urllib2