Skip to content

Instantly share code, notes, and snippets.

View mtvbrianking's full-sized avatar

Brian Matovu mtvbrianking

View GitHub Profile
@mtvbrianking
mtvbrianking / centos-php-install-update.md
Created September 17, 2019 09:32
Centos install or update PHP

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 September 13, 2019 15:21
Laravel Testing 'Before & After' Middleware
<?php
namespace App\Http\Middleware;
use Closure;
class AllowCors
{
/**
* Handle an incoming request.
@mtvbrianking
mtvbrianking / google-maps-place-share-link.js
Last active December 22, 2019 18:03
Generate Google Maps place shareable link.
@mtvbrianking
mtvbrianking / centos-cron-jobs.md
Created July 8, 2019 08:14
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
mtvbrianking / XMLElement.php
Created July 6, 2019 14:46
Custom xml element - with default value getter
<?php
/**
* Custom XML element.
*/
class XMLElement extends \SimpleXMLElement
{
/**
* Provides access to element's children.
*
@mtvbrianking
mtvbrianking / auto-deploying.md
Created June 26, 2019 12:29 — forked from nickbclifford/auto-deploying.md
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...

Users

@mtvbrianking
mtvbrianking / digital-ocean-apache-php-mysql-https.md
Last active June 24, 2023 14:13
Setup digital ocean apache web server php mysql

Prerequisties

Login

bmatovu@home-pc:~# ssh [email protected]

root@ubuntu-512mb-nyc3-01:~$ sudo su

root@ubuntu-512mb-nyc3-01:~#
@mtvbrianking
mtvbrianking / test-artisan-command.md
Last active May 28, 2019 08:40
Test artisan command consumes external API using service container injection.
interface ClientInterface
{
    public function request($method, $uri, $headers = [], $body = []);
}
class Client implements ClientInterface
{
@mtvbrianking
mtvbrianking / pie-chart-custom-legend.html
Created May 26, 2019 19:49
ChartJS pie chart with custom legend in table.
<!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"/>
@mtvbrianking
mtvbrianking / login.html
Created May 24, 2019 20:36
Bootstrap 4 - Minimalist material design vertical, horizontal centered login form
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
@import url('https://fonts.googleapis.com/css?family=Quicksand:400,500');
body {
background-color: #f1f5f8;