Skip to content

Instantly share code, notes, and snippets.

View jamesmills's full-sized avatar

James Mills jamesmills

View GitHub Profile

January 2020

Anupdated version of this can be found on our Treeware About Us Page.

Treeware Launch

We are proud to announce the launch of Treeware.

We have partnered up with Offset Earth, to plant trees & fund the world’s best climate crisis solutions. We chose Offset Earth because they operate transparently with a minimal service fee, which they use to spread the message through social marketing.

$response = (new Client())->post('https://api.datadoghq.com/api/v1/series?api_key=' . config('core.datadog.api_key'),
[
RequestOptions::JSON => [
'series' => [[
'metric' => 'test.metric',
'points' => [
array(365),
array(13456789, 123)
],
// 'type' => 'rate',
<?php
if (!function_exists('applicationUrl')) {
/**
* Will return the fully qualified domain name for the correct environment etc
*
* @param string $sub_domain
* @param string $path
* @return string
THIS := $(realpath $(lastword $(MAKEFILE_LIST)))
HERE := $(shell dirname $(THIS))
.PHONY: fix lint test
fix:
$(HERE)/vendor/bin/php-cs-fixer fix --config=$(HERE)/.php_cs
lint:
$(HERE)/vendor/bin/php-cs-fixer fix --config=$(HERE)/.php_cs --dry-run
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/app')
->in(__DIR__ . '/database/migrations')
;
return PhpCsFixer\Config::create()
->setUsingCache(false)
->setRules([

Keybase proof

I hereby claim:

  • I am jamesmills on github.
  • I am jamesmills (https://keybase.io/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:

@jamesmills
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'), ));

@jamesmills
jamesmills / gist:5748138
Created June 10, 2013 11:34
Get curl header
<?php
$ch = curl_init('http://cts-web-api.cloudapp.net/api/hotels?destination=mgm');
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
jamesmills / tour_booking_details.php
Last active December 11, 2015 05:48
Travel Editions Test
<?php
include('inc/functions.php');
$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