🏴☠️
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.1.8-apache | |
MAINTAINER Paul Redmond | |
COPY . /srv/app | |
COPY .docker/vhost.conf /etc/apache2/sites-available/000-default.conf | |
RUN chown -R www-data:www-data /srv/app \ | |
&& a2enmod rewrite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This interface would be provided by the framework and properly namespaced | |
* This is just an example of what an interface might be like... | |
*/ | |
interface BladeExtension | |
{ | |
public function getDirectives(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dateMixin from './mixins/date'; | |
// Globally | |
Vue.mixin(dateMixin); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Entry<KeyType, ValueType> | |
{ | |
protected KeyType key; | |
protected ValueType value; | |
public Entry(KeyType key, ValueType value) { | |
key = key; | |
value = value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Response; | |
/** | |
* Validate Mailgun Webhooks | |
* @see https://documentation.mailgun.com/user_manual.html#securing-webhooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# when you run a 1 minute schedule command that takes more than 1 minute using `withoutOverlapping()` | |
# Running the scheduler in the background so sleep hits right away... | |
# # Run the scheduler | |
# while [ true ] | |
# do | |
# php artisan schedule:run --verbose --no-interaction & | |
# sleep 60 | |
# done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> $client = app('example.client'); | |
=> GuzzleHttp\Client {#666} | |
>>> json_decode($client->get('http://guzzle-6-demo.app/example')->getBody()->__toString(), true); | |
=> [ | |
"authorization" => [ | |
"Signature keyId="key",algorithm="hmac-sha1",signature="HjQHCSOYw9PA4NKK70Y0GX7es3c%3D"", | |
], | |
"date" => [ | |
"Fri, 07 Apr 2017 05:58:28 UTC", | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Route::get('/example', function () { | |
return request()->headers->all(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use App\HMACRequestHandler; | |
use GuzzleHttp\Client; | |
use GuzzleHttp\Handler\CurlHandler; | |
use GuzzleHttp\HandlerStack; | |
use Illuminate\Support\ServiceProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Carbon\Carbon; | |
use Psr\Http\Message\RequestInterface; | |
class HMACRequestHandler | |
{ | |
private $key; |