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 18, 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 / 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 / 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

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

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...

Users

@mtvbrianking
mtvbrianking / digital-ocean-apache-php-mysql-https.md
Created May 29, 2019
Setup digital ocean apache web server php mysql
View digital-ocean-apache-php-mysql-https.md

Login

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

Update package manager

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

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

@mtvbrianking
mtvbrianking / test-artisan-command.md
Last active May 28, 2019
Test artisan command consumes external API using service container injection.
View test-artisan-command.md
interface ClientInterface
{
    public function request($method, $uri, $headers = [], $body = []);
}
class Client implements ClientInterface
{
@mtvbrianking
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>
<html>
<head>
<title>ChartJS Pie Chart Lengend.</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<!-- <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/all.min.css" rel="stylesheet"/> -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/fontawesome.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/solid.min.css" rel="stylesheet"/>
You can’t perform that action at this time.