Skip to content

Instantly share code, notes, and snippets.


Brian Matovu mtvbrianking

View GitHub Profile
View ubuntu_20_lamp_setup.txt
-- Prerequisites
apt update
apt upgrade
-- Supervisor
apt install supervisor -y
supervisord --version
mtvbrianking /
Created Aug 9, 2021
SSH into remote servers
HOSTS=("", "")
PORTS=("22", "3409")
USERS=("root", "jdoe")
KEYS=("secret", "Ytrewq!123")
mtvbrianking /
Last active Jul 25, 2021
xmllint indent and file overwrite helpers
indent=" "
while [ $# -gt 0 ]
View sublime-text-context-menu-install.bat
@echo off
SET sublPath=C:\Program Files\Sublime Text\sublime_text.exe
rem add context menu to all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Edit with Sublime Text" /t REG_SZ /v "" /d "Edit with Sublime Text" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Edit with Sublime Text" /t REG_EXPAND_SZ /v "Icon" /d "%sublPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Edit with Sublime Text\command" /t REG_SZ /v "" /d "%sublPath% \"%%1\"" /f
rem add context menu to folders
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text" /t REG_SZ /v "" /d "Open with Sublime Text" /f
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>