Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Brian Matovu mtvbrianking

🎯
Focusing
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
mtvbrianking / api-request-token.md
Last active Sep 21, 2019
Sample API request tokens requests
View api-request-token.md
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...'
View centos-php-install-update.md

Centos install or update PHP

https://tecadmin.net/nstall-php7-on-centos6/

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
mtvbrianking / AllowCors.php
Last active Sep 13, 2019
Laravel Testing 'Before & After' Middleware
View AllowCors.php
<?php
namespace App\Http\Middleware;
use Closure;
class AllowCors
{
/**
* Handle an incoming request.
@mtvbrianking
mtvbrianking / mtn-momo-api.md
Last active Sep 11, 2019
MTN MOMO API Requests
View mtn-momo-api.md
@mtvbrianking
mtvbrianking / tailwind-laravel-mix-setup.md
Last active Aug 31, 2019
Setting up Tailwind using Laravel Mix
View tailwind-laravel-mix-setup.md

[Boot NPM]

vim package.json

{
  "private": true,
  "dependencies": {},
  "devDependencies": {},
  "scripts": {
@mtvbrianking
mtvbrianking / artisan-route-list.php
Created Apr 7, 2019
Laravel PHP Artisan route list
View artisan-route-list.php
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Route;
class HomeController extends Controller
{
/**
* Constructor.
@mtvbrianking
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
mtvbrianking / supervisor-setup.md
Last active Jul 12, 2019
Setup supervisor process monitor, centos
View supervisor-setup.md

[TOC]

Supervisor is a process monitor for the Linux operating system.

Prerequisites

Check CentOS version

sudo rpm -q centos-release

@mtvbrianking
mtvbrianking / array_dump_tree.php
Last active Jul 10, 2019
Print array elements as a tree
View array_dump_tree.php
<?php
$access = '{"permissions":{"accounts":{"users":["create"],"user_roles":["create","view"]},"assets":{"devices":["create","view","edit"]}}}';
$perms = json_decode($access, true)['permissions'];
// https://stackoverflow.com/a/177476/2732184 :: Recurvise print array
// https://stackoverflow.com/a/262944/2732184 :: Array Depth
function dump(&$array, $level = 0)
{
@mtvbrianking
mtvbrianking / centos-cron-jobs.md
Created Jul 8, 2019
Setup cron jobs on centos
View centos-cron-jobs.md

Centos cron jobs

  1. Let's create a directory this purpose.

# cd

[root@server ~]# mkdir crontests

[root@server ~]# cd crontests

You can’t perform that action at this time.