Skip to content

Instantly share code, notes, and snippets.

View jamesmills's full-sized avatar

James Mills jamesmills

View GitHub Profile
jamesmills / .zsh_alias
Last active August 29, 2015 14:04
# Add 'source ~/.zsh_alias' to the bottom of ~/.zshrc to use
# Can also add to these to /Homestead/aliases for us with your Homestead VM
# Composer
alias csu="composer self-update"
alias cu="composer update"
alias ci="composer install"
alias cda="composer dump-autoload -o"
# Laravel / Artisan
jamesmills / createCallAdGroupFeed.php
Last active August 29, 2015 14:04
This will associate a given FeedItem with an AdGroup.
protected function createCallAdGroupFeed(AdWordsUser $user, $feed, $feed_item, $adgroup)
// Get the CampaignFeedService, which loads the required classes.
$adGroupFeedService = $user->GetService('AdGroupFeedService');
$feedFunctionRequestContextOperand = new RequestContextOperand();
$feedFunctionRequestContextOperand->contextType = 'FEED_ITEM_ID';
jamesmills / gist:3667389
Created September 7, 2012 15:57
Tesco API - Issue 1
There is an error with the response from the CHANGEBASKET function.
Should not return
{ "StatusCode": 0, "StatusInfo": "Basket change completed successfully" }
jamesmills / gist:3930151
Created October 22, 2012 07:38
<script type="text/javascript" charset="utf-8">
function findLocation()
navigator.geolocation.getCurrentPosition(foundLocation, noLocation);
function foundLocation(position)
jamesmills / index.php
Created December 18, 2012 13:04
Tour Offer Title
$content = new SimpleXMLElement(file_get_contents(''));
foreach ($content->Tours->Tour as $tour) {
if ($tour->Country['Name'] == 'United Kingdom') {
echo '<p>' . htmlentities($tour->OfferTitle, ENT_QUOTES | ENT_IGNORE, "UTF-8") . '</p>';
jamesmills / tour_booking_details.php
Last active December 11, 2015 05:48
Travel Editions Test
$myTourOS = new TourOs();
// Get a new session from Tours API and store it in out own session to use it again
$_SESSION['tourOsToken'] = (string)$myTourOS->getSession();
output($_SESSION['tourOsToken'], 'tourOsToken');
// get the detials of the departure sending our own session and the ID sent in the URI
jamesmills / gist:5748138
Created June 10, 2013 11:34
Get curl header
$ch = curl_init('');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Range: items=1-5'));
$response = curl_exec($ch);
jamesmills / gist:7638596
Last active December 29, 2015 07:49
Local Environment for Laravel

On Mac:

NOTE: Since updating my mac to OSX 10.9 (Mavericks) my local enviroment was not working. Turns out the hostname has changed.

Open Terminal and run hostname.

Open bootstrap/start.php and add $env = $app->detectEnvironment(array( 'local' => array('YOUR-HOSTNAME'), ));

Keybase proof

I hereby claim:

  • I am jamesmills on github.
  • I am jamesmills ( on keybase.
  • I have a public key whose fingerprint is E216 5344 E65C D7D9 19C7 95D7 1244 7E3B A4D3 E51C

To claim this, I am signing this object: