Skip to content

Instantly share code, notes, and snippets.

View jamesmills's full-sized avatar

James Mills jamesmills

View GitHub Profile

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.

$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
<?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;
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 / createCallAdGroupFeed.php
Last active August 29, 2015 14:04
This will associate a given FeedItem with an AdGroup.
<?php
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
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);