Skip to content

Instantly share code, notes, and snippets.

View matthewhaworth's full-sized avatar

Matthew Haworth matthewhaworth

  • MH Web Development Ltd
  • Manchester, UK
View GitHub Profile
@matthewhaworth
matthewhaworth / iphone-stock.js
Created October 29, 2021 09:11
iPhone Stock Detector
/**
* I found the availability json by looking for XHR requests on this page:
* https://www.apple.com/uk/shop/iphone/iphone-upgrade-program
*
* I'm not completely sure if it will help if you're not using the upgrade program, but it does
* seem to have two flags for availability, 'unlocked' and 'contract'.
*/
import fetch from 'node-fetch';
@matthewhaworth
matthewhaworth / magento_gallery.js
Last active August 29, 2015 14:07
Magento Gallery
@matthewhaworth
matthewhaworth / gist:bf89572c07b7e546e1eb
Last active August 29, 2015 14:01
Adanced Custom Fields Object Oriented
<?php
$fieldset = new CodepoolFieldset('two_column_fieldset', 'Two Column', array('the_content'));
$fieldset->addField(new CodepoolField('left_content_title', 'Left Content Title', 'text'));
$fieldset->addField(new CodepoolField('left_content_subtitle', 'Left Content Subtitle', 'text'));
$fieldset->addField(new CodepoolField('left_content_image', 'Left Image', 'image'));
$fieldset->addField(new CodepoolField('left_content', 'Left Content', 'wp_wysiwyg'));
$fieldset->addField(new CodepoolField('right_content_title', 'Right Content Title', 'text'));
$fieldset->addField(new CodepoolField('right_content_subtitle', 'Right Content Subtitle', 'text'));
$fieldset->addField(new CodepoolField('right_content_image', 'Right Image', 'image'));
@matthewhaworth
matthewhaworth / gist:bfc300ecb5a75618d0d5
Last active January 1, 2016 06:09
Magento Install Script
#!/bin/sh
DEFAULT_MAGENTO_VERSION=1.7.0.2
DEFAULT_MAGE_URL="http://127.0.0.1/"
if [ -z $1 ] # Magento version
then
read -p "Choose Magento version ($DEFAULT_MAGENTO_VERSION): " MAGENTO_VERSION
if [ -z "$MAGENTO_VERSION" ]
then