Skip to content

Instantly share code, notes, and snippets.

View OlabodeAbesin's full-sized avatar
🏠
Working from home

Ola Abesin OlabodeAbesin

🏠
Working from home
  • London
  • 20:24 (UTC)
View GitHub Profile
@OlabodeAbesin
OlabodeAbesin / states
Created January 28, 2022 07:13
Nigeria states, name, code and zone id
insert into state(id,name,code,zone_id,sales_region,country_id,created_date,active_status) values("1","Abia","NG-AB","4","SOUTH_EAST","152","2022-01-28 03:30:05","ACTIVE");
insert into state(id,name,code,zone_id,sales_region,country_id,created_date,active_status) values("2","Adamawa","NG-AD","1","NORTH_EAST","152","2022-01-28 03:30:05","ACTIVE");
insert into state(id,name,code,zone_id,sales_region,country_id,created_date,active_status) values("3","Akwa Ibom","NG-AK","3","SOUTH_SOUTH","152","2022-01-28 03:30:05","ACTIVE");
insert into state(id,name,code,zone_id,sales_region,country_id,created_date,active_status) values("4","Anambra","NG-AN","4","SOUTH_EAST","152","2022-01-28 03:30:05","ACTIVE");
insert into state(id,name,code,zone_id,sales_region,country_id,created_date,active_status) values("5","Bauchi","NG-BA","1","NORTH_EAST","152","2022-01-28 03:30:05","ACTIVE");
insert into state(id,name,code,zone_id,sales_region,country_id,created_date,active_status) values("6","Bayelsa","NG-BY","3","SOUTH_SOUTH","152","
@OlabodeAbesin
OlabodeAbesin / Countries
Created January 28, 2022 07:11
List of countries, citizen names and country phone code
insert into country(id,name,nationality,dialling_code,created_date,active_status) values("1","Afghanistan","Afghan","+93","2022-01-28 03:30:05","ACTIVE");
insert into country(id,name,nationality,dialling_code,created_date,active_status) values("2","Albania","Albanian","+355","2022-01-28 03:30:05","ACTIVE");
insert into country(id,name,nationality,dialling_code,created_date,active_status) values("3","Algeria","Algerian","+213","2022-01-28 03:30:05","ACTIVE");
insert into country(id,name,nationality,dialling_code,created_date,active_status) values("4","American Samoa","","+684","2022-01-28 03:30:05","ACTIVE");
insert into country(id,name,nationality,dialling_code,created_date,active_status) values("5","Andorra","Andorran","+376","2022-01-28 03:30:05","ACTIVE");
insert into country(id,name,nationality,dialling_code,created_date,active_status) values("6","Angola","Angolan","+244","2022-01-28 03:30:05","ACTIVE");
insert into country(id,name,nationality,dialling_code,created_date,active_status) values("7","Anguilla
@OlabodeAbesin
OlabodeAbesin / SlackRequest.php
Created January 16, 2022 21:10 — forked from pingcheng/SlackRequest.php
Laravel middleware for validating slack signing secret
<?php
namespace App\Http\Middleware;
use Exception;
use Carbon\Carbon;
use Closure;
use Illuminate\Support\Facades\Log;
class SlackRequest
@OlabodeAbesin
OlabodeAbesin / gist:e81fcbd943579b0e2bd26c5f4a33e0d9
Created September 28, 2021 14:52
Given a string str consisting of letters only and an integer n, the task is to replace every character of the given string by a character which is n times more than it. If the letter exceeds ‘z’, then start checking from ‘a’ in a cyclic manner. Examples: Input: str = “abc”, n = 2 Output: cde a is moved by 2 times which results in character c b i…
<?php
// PHP program to move every character
// n times ahead in a given string
// Function to move string character
function encode($s, $n)
{
// changed string
$newS = "";
{
"status": "success",
"data": {
"uuid": "ea5030cf-9273-49d0-8065-20e0346bb8bd",
"firstName": "Olabode",
"lastName": "Abesin",
"email": "[email protected]",
"referralCode": "VC2CMY",
"dateLastLogin": "2020-08-13",
"defaultCurrency": "NGN",
@OlabodeAbesin
OlabodeAbesin / isocodes
Created July 1, 2020 19:37
Countries, ISO codes, units and sub units
$currencies = [ ['priority' => '100',
'iso_code' => 'AED',
'name' => 'United Arab Emirates Dirham',
'symbol' => 'د.إ',
'subunit' => 'Fils',
'subunit_to_unit' => '100',
'symbol_first' => true,
'html_entity' => '',
'decimal_mark' => '.',
'thousands_separator' => ',',
@OlabodeAbesin
OlabodeAbesin / NIbssistitutionlist
Last active October 17, 2024 13:20
Nigerian bank, bank/institution codes and logo
[
{
"id": 376,
"InstitutionCode": "090270",
"InstitutionName": "AB MICROFINANCE BANK",
"Category": "9",
"dump": null,
"created_at": "2020-03-02 20:44:54",
"updated_at": "2020-08-24 00:02:52",
"deleted_at": null,
public function restore()
{
$array = [12906, 12973, 12978, 13045, 13051, 13107, 13111, 13183, 13186, 13249, 13250, 13166, 13167, 13169, 13234, 13236, 13219];
$failed = array();
foreach ($array as $key => $arrayvalue) {
try {
$transaction = Transaction::where('id', $arrayvalue)->first();
$transaction->restore();
} catch (\Throwable $th) {
$failed[] = $arrayvalue;
public function quickFix(){
$array = [8910, 8906, 8905, 8904, 8903, 8902, 8901, 8900, 8899, 8898, 8897, 8896, 8895, 8894, 8893, 8892, 8887, 8886, 8885, 8884, 8883, 8882, 8879, 8877, 8868, 8867, 8866, 8865, 8864, 8863, 8862, 8861, 8860, 8859, 8857, 8856, 8855, 8854, 8852, 8850, 8849, 8847, 8845, 8844, 8843, 8842, 8841, 8840, 8839, 8838, 8837, 8836, 8831, 8830, 8829, 8828, 8827, 8826, 8825, 8824, 8823, 8822, 8821, 8820, 8819, 8818, 8817, 8816, 8815, 8814, 8813, 8812, 8811, 8810, 8809, 8808, 8807, 8806, 8805, 8804, 8803, 8802, 8801, 8800, 8799, 8797, 8796, 8795, 8794, 8793, 8792, 8791, 8790, 8789, 8786, 8785, 8784, 8783, 8782, 8781, 8780, 8779, 8778, 8777, 8775, 8774, 8773, 8772, 8771, 8770, 8769, 8768, 8766, 8765, 8764, 8763, 8762, 8761, 8759, 8758, 8757, 8756, 8755, 8754, 8752, 8751, 8750, 8749, 8748, 8747, 8746, 8745, 8744, 8743, 8742, 8741, 8739, 8738, 8737, 8736, 8735, 8734, 8733, 8732, 8731, 8730, 8729, 8728, 8725, 8724, 8723, 8722, 8721, 8720, 8714, 8713, 8712, 8711, 8710, 8709, 8707, 8706, 8705,
@OlabodeAbesin
OlabodeAbesin / Exception.java
Last active May 5, 2020 17:42
Recursively take input until validation is right
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void validateMenu(Scanner sc) {
System.out.print("Please enter a valid input, between 1 and 6: ");
int menuChoice = sc.nextInt();
try {
if (menuChoice < 1 || menuChoice > 6 || menuChoice != (int)menuChoice) {