Skip to content

Instantly share code, notes, and snippets.

View matthbull's full-sized avatar

DevDonkey matthbull

View GitHub Profile

Keybase proof

I hereby claim:

  • I am matthbull on github.
  • I am matthb (https://keybase.io/matthb) on keybase.
  • I have a public key ASA7VfFOhuFEtlqAHOoY1HidNSmDRBS3uWIoiL13j7t11wo

To claim this, I am signing this object:

@matthbull
matthbull / JwtTokenAuthenticator.php
Created July 12, 2017 09:17
JWTGuard authenticator - symfony 3
<?php
/**
* Date: 07/04/17
* Time: 09:51
*/
namespace AppBundle\Security;
use AppBundle\Api\ResponseFactory;
use AppBundle\Exception\ApiProblem;
use AppBundle\Services\LoggerAwareInterface;
use AppBundle\Traits\LoggerAwareTrait;
@matthbull
matthbull / MenuBuilder.php
Last active February 12, 2017 08:22
KnpMenuBundle - override knp_menu.html.twig to use bootstrap 3 and fontawesome.
<?php
namespace AppBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
@matthbull
matthbull / backup_to_s3.sh
Created January 6, 2016 10:17
Tar and sync compressed files to an Amazon Web Services S3 bucket.
#!/bin/sh
# Author: Matt Holbrook-Bull
# Description: Tar and upload files to an AWS S3 bucket. Also backs up apache sites-available config files (take this out if you dont need it)
# Setup: you need to install the AWS CLI - http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html
# To run this automatically setup a root crontab job
# Will remove backups over 5 days old. Edit line 31/32 to adjust this retention period.
# alter these prefs to specify your S3 bucket location, local storage path on your server, and the source path of your required backups
DATE=`date +%d%m%y%H%M`
S3PATH=XXXXXX
@matthbull
matthbull / switchphp.sh
Last active May 1, 2018 13:05
Wraps `phpbrew switch xx` in a shell script to facilitate automatic php switching in apache as well as the standard cli
#!/bin/bash
# wraps phpbrew switch to enable apache switching
# Author: Matt Holbrook-Bull
#
# requirements:
# /etc/apache2/modules must be writable
# you must have apxs2 extension compiled into your php installs
# "chmod +x switchphp.sh" - to make executable
#
# usage: