Skip to content

Instantly share code, notes, and snippets.

View mtvbrianking's full-sized avatar

Brian Matovu mtvbrianking

View GitHub Profile
@mtvbrianking
mtvbrianking / jquery-datatables-bootstrap4.html
Last active April 26, 2023 09:23
jQuery Datatables Bootstrap
<!DOCTYPE html>
<html>
<head>
<title>jQuery Datatables</title>
<!-- Default styling not required with bs stylying. -->
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.19/css/jquery.dataTables.min.css"> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.19/css/dataTables.bootstrap4.min.css">
@mtvbrianking
mtvbrianking / php proxy demo.md
Last active April 11, 2023 19:52
PHP Forwarding Proxy

Authentication

.env

  ...
+ PROXY_AUTH_KEY=Bj5pnZEX6DkcG6Nz6AjDUT1bvcGRVhRaXDuKDX9CjsEs2
@mtvbrianking
mtvbrianking / MainActivity.java
Created March 27, 2023 09:57 — forked from ibstelix/MainActivity.java
Android: How to collect the response of a USSD request (Including multi-session requests)
//Get the instance of TelephonyManager
final TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
try {
if (tm != null) {
Class telephonyManagerClass = Class.forName(tm.getClass().getName());
if (telephonyManagerClass != null) {
Method getITelephony = telephonyManagerClass.getDeclaredMethod("getITelephony");
@mtvbrianking
mtvbrianking / form-submission.php
Last active March 25, 2023 10:55
PHP JS form submission using multipe actions
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form Submission</title>
<style>
.form-group {
@mtvbrianking
mtvbrianking / OneTwoGuard.php
Created March 8, 2023 09:16
Laravel MultiAuth - Guard & User Provider
<?php
namespace App\Modules\OneTwos\Auth;
use Illuminate\Auth\SessionGuard;
class OneTwoGuard extends SessionGuard
{
// ...
}
@mtvbrianking
mtvbrianking / linux-foundation.md
Created October 5, 2021 18:45
Linux Foundation Certifiactions - LFCA . LFCS . LFCE

Linux Foundation Certified

IT Associate (LFCA)

Linux Fundamentals - 20%

  • Linux Operating System
  • File Management Commands
  • System Commands
  • General Networking Commands
@mtvbrianking
mtvbrianking / openssl-mtls.md
Last active December 27, 2022 08:49
OpenSSL / MTLS / Wildcard Certificates / Subject Alternative Name

Certificate Authority

Self Signing CA for local dev

openssl req -x509 -nodes -newkey rsa:4096 -keyout ca.key -out ca.crt -days 365 -subj "/CN=poseidon"

Server

const withdrawMachine = Machine(
{
id: 'withdraw',
initial: 'created',
context: {
signatures: 0,
corum: 3
},
states: {
created: {
@mtvbrianking
mtvbrianking / artisan-cheatsheet.md
Last active December 4, 2022 23:13
Laravel Artisan Command Cheatsheet

Model

php artisan make:model Post

Specify the model path like;

php artisan make:model Models/Post

This model will be created at App\Models\Post instead of App\Post

@mtvbrianking
mtvbrianking / bash-command-arguments-options.txt
Created December 26, 2021 11:02
bash command stdin arguments options
bash arguments options stdin flags
required
optional
./cmd arg1 agr2 --debug --output=test.txt
Args:
- arg1