Skip to content

Instantly share code, notes, and snippets.


Brian Matovu mtvbrianking

Block or report user

Report or block mtvbrianking

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mtvbrianking /
Last active Sep 18, 2019
Sample API request tokens requests
curl -X POST \
  http://localhost:8000/api/v1/oauth/token \
  -H 'Accept: application/json' \
  -d 'grant_type=authorization_code' \
  -d 'client_id=b8e7163a-83a0-4386-b0bc-697a96edef14' \
  -d 'client_secret=bNQbpQnMPXayTn8XFPRQDWvIyyclN5pKnccVVUNx' \
  -d 'redirect_uri=http://localhost:8000/test/callback' \
  -d 'code=def502006626c316151b4f074308...'

Centos install or update PHP

yum --enablerepo=remi-php73 install php-mbstring php-gd php-intl php-xml php-mysql php-zip php-json php-soap php-pecl-zip

Centos php zip extension

yum --enablerepo=remi-php73 install php-pecl-zip

mtvbrianking / AllowCors.php
Last active Sep 13, 2019
Laravel Testing 'Before & After' Middleware
View AllowCors.php
namespace App\Http\Middleware;
use Closure;
class AllowCors
* Handle an incoming request.
mtvbrianking / google-maps-place-share-link.js
Last active Aug 9, 2019
Generate Google Maps place shareable link.
View google-maps-place-share-link.js
mtvbrianking /
Created Jul 8, 2019
Setup cron jobs on centos

Centos cron jobs

  1. Let's create a directory this purpose.

# cd

[root@server ~]# mkdir crontests

[root@server ~]# cd crontests

mtvbrianking / XMLElement.php
Created Jul 6, 2019
Custom xml element - with default value getter
View XMLElement.php
* Custom XML element.
class XMLElement extends \SimpleXMLElement
* Provides access to element's children.
mtvbrianking /
Created Jun 26, 2019 — forked from nickbclifford/
How to automatically deploy code to a server using Travis CI

Auto-Deploying via Travis CI

Because Travis CI can automatically execute scripts after successfully (or unsuccessfully!) executing tests, it is an obvious choice for a deployment tool. In order to deploy to a Git repository on a remote server, the process generally is as follows:

  • Set up SSH keys
  • Add the server's copy of the repository as a Git remote
  • Push to the remote
  • SSH into the server and execute any installation/compilation/miscellaneous commands

Before even touching .travis.yml...


mtvbrianking /
Created May 29, 2019
Setup digital ocean apache web server php mysql


root@ubuntu-512mb-nyc3-01:~# ssh

Update package manager

root@ubuntu-512mb-nyc3-01:~# apt-get update

root@ubuntu-512mb-nyc3-01:~# apt-get upgrade

mtvbrianking /
Last active May 28, 2019
Test artisan command consumes external API using service container injection.
interface ClientInterface
    public function request($method, $uri, $headers = [], $body = []);
class Client implements ClientInterface
mtvbrianking / pie-chart-custom-legend.html
Created May 26, 2019
ChartJS pie chart with custom legend in table.
View pie-chart-custom-legend.html
<!DOCTYPE html>
<title>ChartJS Pie Chart Lengend.</title>
<link href="" rel="stylesheet"/>
<!-- <link href="" rel="stylesheet"/> -->
<link href="" rel="stylesheet"/>
<link href="" rel="stylesheet"/>
You can’t perform that action at this time.