Skip to content

Instantly share code, notes, and snippets.


Brian Matovu mtvbrianking

View GitHub Profile
mtvbrianking / filter-on-return.js
Created Oct 31, 2020
jQuery filter on return
View filter-on-return.js
$.extend(true, $.fn.dataTable.defaults, {
initComplete: function(settings, json) {
var api = this.api();
var dtFilter = $.fn.dataTable.settings[0].aanFeatures.f;
var dtFilterInput = $('input', dtFilter);
View laravel-routes.php
use Illuminate\Support\Facades\Route;
function matches($patterns, $subject)
if(! is_array($patterns)) {
return preg_match($patterns, $subject);
mtvbrianking / vuejs-select-binding-2.vue
Last active Oct 19, 2020
vuejs select element binding
View vuejs-select-binding-2.vue
<div id="checkout">
<div class="row mt-3">
<div class="col-12 form-group">
<label class="text-small text-uppercase required" for="payment_gateway">Payment Method</label>
<select id="payment_gateway" name="payment_gateway" class="form-control"
v-on:change="chooseGateway($event)" v-model="selected">
<option v-for="_gateway in gateways"
View jquery-single-vs-multiple-selection.html
<!DOCTYPE html>
<title>jQuery Single vs Multiple Selection</title>
.items {
padding: 0;
margin: 0;
list-style: none;
display: -webkit-box;
mtvbrianking / array-of-objects-search.js
Last active May 27, 2021
Javascript array of objects search
View array-of-objects-search.js
"use strict";
var users = [
id: 1,
alias: "jdoe",
name: "John Doe"
id: 2,
mtvbrianking / index.html
Created Sep 29, 2020
JavaScript Windows and iFrames
View index.html
<!DOCTYPE html>
<title>Parent Window</title>
<input type="text" name="avatar" readonly>
mtvbrianking / build-nested-tree.php
Last active Oct 6, 2020
Build nested tree from flat array.
View build-nested-tree.php
$categories = [
['id' => 1, 'name' => 'TV & Home Theater', 'parent_id' => null,],
['id' => 2, 'name' => 'Tablets & E-Readers', 'parent_id' => null,],
['id' => 3, 'name' => 'Computers', 'parent_id' => null,],
['id' => 4, 'name' => 'Laptops', 'parent_id' => 3,],
['id' => 5, 'name' => 'PC Laptops', 'parent_id' => 4,],
['id' => 6, 'name' => 'Macbooks (Air/Pro)', 'parent_id' => 4,],
['id' => 7, 'name' => 'Desktops', 'parent_id' => 3,],
mtvbrianking / dynamic-charts.js
Last active Jul 6, 2020
Create dynamic charts using ChartJS
View dynamic-charts.js
<!DOCTYPE html>
<title>Dynamic Charts</title>
<link href="" rel="stylesheet">
<div class="container-fluid">
<div id="wrapper" class="row"></div>
mtvbrianking /
Last active Nov 17, 2021
Install Redis on Xampp - Windows



jdoe@home-pc:~# apt-get install redis-server
jdoe@home-pc:~# systemctl enable redis-server@.service
jdoe@home-pc:~# apt-get update
jdoe@home-pc:~# apt-cache pkgnames | grep php7.4
jdoe@home-pc:~# apt install php7.4-redis
mtvbrianking / gitlab-ci.yml
Created Mar 28, 2020
Gitlab pages deploy swagger docs
View gitlab-ci.yml
# This file is a template, and might need editing before it works on your project.
image: node:10-alpine
# specify the location of the Open API Specification files within your project
# and the filename of the specification that you would like to display by default
DOCS_FOLDER: "specs"
SPEC_TO_DISPLAY: "rects.yaml"