Skip to content

Instantly share code, notes, and snippets.

View mtvbrianking's full-sized avatar

Brian Matovu mtvbrianking

View GitHub Profile
@mtvbrianking
mtvbrianking / run-tests.yml
Last active November 15, 2024 09:21
Bash Automated Testing System (BATS)
# 1. Download the backend proxy server
# 2. Install and server the proxy server
# 3. Run tests while pointing to the proxy localhost:3000
name: Frontend CI Workflow
on:
push:
branches:
- main
@mtvbrianking
mtvbrianking / tao-setup.md
Last active September 24, 2024 06:10
TAO LMS

What is TAO?

TAO is an Open Source e-Testing platform that empowers you to build, deliver, and share innovative and engaging assessments online – in any language or subject matter.

TAO ("Computer-Based Testing" or Testing Assisté par Ordinateur in French), was created by the University of Luxembourg and is now maintained primarily by Open Assessment Technologies (OAT).

Resources

For a detailed documentation of the installation process please visit our Administrator Guide:

@mtvbrianking
mtvbrianking / laravel validation attributes.md
Created September 24, 2023 17:30
Laravel validation attributes

Issue

Attribute names are replaced. E.g 'from_account_id' to 'from account id'

{
    "errors": {
        "to_account_id": [
            "The to account id field and from account id must be different."
        ],
@mtvbrianking
mtvbrianking / chartjs_timeseries.html
Last active January 12, 2024 07:16
chart.js timeseries demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>chart.js timeseries demo</title>
</head>
<body style="padding: 25px; margin: 25px;">
<div style="width: 85%">
@mtvbrianking
mtvbrianking / chartjs-plugin-zoom-utils.js
Created July 23, 2023 16:24
Chart.js Zoom Plugin Utils
// https://github.com/chartjs/chartjs-plugin-zoom/blob/master/docs/scripts/utils.js
import { addDays, addHours, startOfWeek, endOfWeek, isWeekend, nextMonday, getHours, setHours } from "https://cdn.jsdelivr.net/
function valueOrDefault(value, defaultValue) {
return typeof value === 'undefined' ? defaultValue : value;
}
// Adapted from http://indiegamr.com/generate-repeatable-random-numbers-in-js/
let _seed = Date.now();
@mtvbrianking
mtvbrianking / mobile money origins.md
Created May 15, 2023 19:34
Researching the origins of Mobile Money

Some literature lists Mozabique's mKesh / mCell as the first mobile money service in the world back in 2002

You are correct. I apologize for my earlier answer which was not accurate.

The first mobile money service in the world was indeed launched in Mozambique in 2002 and was called "M-Pesa". It was launched by Vodafone and Mozambique's national mobile network operator, mCel, and was aimed at providing a way for migrant workers to send money back to their families in rural areas.

"M-Pesa" is distinct from the better-known "M-Pesa" mobile money service launched by Vodafone and Safaricom in Kenya in 2007. However, both services were inspired by the success of the original M-Pesa service in Mozambique.

I apologize for any confusion my earlier answer may have caused and thank you for bringing this to my attention.

@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 October 24, 2024 16:58
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 / php proxy demo.md
Last active April 11, 2023 19:52
PHP Forwarding Proxy

Authentication

.env

  ...
+ PROXY_AUTH_KEY=Bj5pnZEX6DkcG6Nz6AjDUT1bvcGRVhRaXDuKDX9CjsEs2
@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
{
// ...
}