Skip to content

Instantly share code, notes, and snippets.

View jamesmills's full-sized avatar

James Mills jamesmills

View GitHub Profile
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/app')
->in(__DIR__ . '/database/migrations')
;
return PhpCsFixer\Config::create()
->setUsingCache(false)
->setRules([
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
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
$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',

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.

@jamesmills
jamesmills / TreewareCombined.md
Last active April 7, 2020 09:34
Treeware Combined

Treeware Treeware Treeware (Trees)

Licence

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

@jamesmills
jamesmills / AdGroupCallExtension.php
Last active June 24, 2020 08:09
Google Adwords API. Creating a Call Extension for an AdGroup.
<?php
public function fire()
{
// See the Placeholder reference page for a list of all the placeholder types and fields.
// https://developers.google.com/adwords/api/docs/appendix/placeholders.html
define('PLACEHOLDER_SITELINKS', 1);
define('PLACEHOLDER_FIELD_SITELINK_LINK_TEXT', 1);
define('PLACEHOLDER_FIELD_SITELINK_URL', 2);

Treeware Option One

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

Treeware Option Two

You're free to use this package, but if it makes it to your production environment you are required to buy the world a tree.

It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to plant trees. If you support this package and contribute to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

<?php
namespace App\Http\Requests\Api;
use Illuminate\Http\JsonResponse;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Validation\ValidationException;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Foundation\Http\FormRequest as LaravelFormRequest;