Skip to content

Instantly share code, notes, and snippets.

View thedumbtechguy's full-sized avatar

TheDumbTechGuy thedumbtechguy

  • Wildcard Technologies
  • Accra, Ghana
View GitHub Profile
@thedumbtechguy
thedumbtechguy / name_matcher.rb
Created February 11, 2025 13:34
Ruby Name Matcher
require 'jaro_winkler'
class NameMatcher
ACCEPTANCE_THRESHOLD = 0.9
COMMON_TITLES = /(Mr|Mrs|Ms|Miss|Dr|Prof)/i
CONJUNCTIONS = /(and)/i
COMMON_SUFFIXES = /(Jr|Sr|III|II|IV)/i
# TODO: Some weird ones we've seen are
# LC = Limited Company
Loan No. RGN Account Name Principal Bal. Interest Bal. Total Disbursed End Date Int. Rate Tenure Current Inst. Rem. Inst. Prinpal Pyt(Mth) Int. Pyt(Mth) Total Pyt(Mth) CAGD Payment Disbursed amount Acc. Int.
1001 100 AaA 944.44 510 1454.44 06/09/2023 06/09/2025 3 18 1 17 55.56 30 85.56 86 1000 540
1002 200 BaB 944.44 510 1454.44 09/09/2023 09/09/2025 3 18 1 17 55.56 30 85.56 86 1000 540
1003 300 CaC 888.89 480 1368.89 31/08/2023 31/08/2025 3 18 2 16 55.56 30 85.56 86 1000 540
1004 400 DaD 944.44 510 1454.44 09/09/2023 09/09/2025 3 18 1 17 55.56 30 85.56 86 1000 540
1005 500 EaE 888.89 480 1368.89 09/08/2023 09/08/2025 3 18 2 16 55.56 30 85.56 86 1000 540
1006 600 FaF 944.44 425 1369.44 11/09/2023 11/09/2025 2.5 18 1 17 55.56 25 80.56 81 1000 450
1007 700 GaG 944.44 425 1369.44 12/09/2023 12/09/2025 2.5 18 1 17 55.56 25 80.56 81 1000 450
<div data-controller="has-many-panel frame-navigator">
<div class="relative bg-white dark:bg-gray-800 shadow-md sm:rounded-lg my-3 overflow-hidden">
<div class="p-4">
<div class="flex justify-between items-center mb-4">
<h5 class="text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
Client admins
</h5>
<div class="flex">
<button title="Back" class="mr-2 text-gray-600 dark:text-gray-300" style="display:none" data-frame-navigator-target="backButton">
<svg class="w-8 h-8" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
<script>
/*
(c) by Thomas Konings
Random Name Generator for Javascript
*/
// https://shockwaveinnovations.com/code-names/
function capFirst(string) {
return string.charAt(0).toUpperCase() + string.slice(1)
@thedumbtechguy
thedumbtechguy / USSDSimulator.html
Created January 30, 2019 10:42
A simple USSD simulator using fetch, prompt and alert. Can be easily adapted to any spec.
<input type="text" id="phone" placeholder="0200672215" />
<button class="btn" id="sendBtn">Send</button>
<script>
var input = document.getElementById('phone');
var makeRequest = function(messageType, sessionId, message) {
@thedumbtechguy
thedumbtechguy / App.elm
Last active July 9, 2017 18:40
Elm Parent Child Communication
module App exposing (Model, initialModel, update, view)
import Html exposing (..)
import Login as Login
type alias Model =
{ loginModel : Login.Model
, pressCount : Int
}
@thedumbtechguy
thedumbtechguy / debug.yml
Created May 3, 2017 19:36
'ansible.vars.unsafe_proxy.AnsibleUnsafeText object' has no attribute
[{
u 'username': u 'ptadmin',
u 'password': AnsibleVaultEncryptedUnicode($ANSIBLE_VAULT; 1.1; AES256\ n32656663616338666438643633366564383461386435626139353766313766306435346633376435\ n3962326635646666333935306334346561636564343239310a373630626132396632303736613861\ n30383361386364656435393330333131373531343030313430663266633233383464323533313737\ n3330393362306265300a353036393636353035303439666637633339626138626164303532633464\ n3135\ n),
u 'use_sudo': True,
u 'use_ssh': False
}, {
u 'username': u 'ansibleremote',
u 'public_key': AnsibleVaultEncryptedUnicode($ANSIBLE_VAULT; 1.1; AES256\ n66383966626637393239373434313261393234666233386165326230623034373762636438363464\ n6162386434643364376136356335663933633664376339610a393734653236316330336162653131\ n38633336333864633930363039326334323863353062313037653566663234326465336636323035\ n6561373463636337320a356361343062633630356136613130633562613830303162316138356531\ n33646536666165356334336465313531646465393632336133376236323565643731356
@thedumbtechguy
thedumbtechguy / ansible_semaphore_ubuntu.md
Last active August 21, 2019 21:14
Install Ansible Semaphore on Ubuntu

Ansible Installation

Ansible is a powerful configuration management tool that we use in managing our infrastructure and applications.

It requires a centralized Control server and can connect to hosts over an array of connection types including SSH.

Controller Setup

The Ansible controller will run our playbooks. This needs both Ansible and Semaphore (web based management console) setup.

@thedumbtechguy
thedumbtechguy / nationality.html
Created December 5, 2016 15:42 — forked from didats/nationality.html
Nationality List in HTML Dropdown
<select name="nationality">
<option value="">-- select one --</option>
<option value="afghan">Afghan</option>
<option value="albanian">Albanian</option>
<option value="algerian">Algerian</option>
<option value="american">American</option>
<option value="andorran">Andorran</option>
<option value="angolan">Angolan</option>
<option value="antiguans">Antiguans</option>
<option value="argentinean">Argentinean</option>
@thedumbtechguy
thedumbtechguy / FolioGlidePage
Created May 19, 2016 14:14
A Folio Page that supports using Glide
import android.support.annotation.StringRes;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.manager.Lifecycle;
import com.bumptech.glide.manager.LifecycleListener;