Skip to content

Instantly share code, notes, and snippets.

View ibrahimlawal's full-sized avatar

Ibrahim Lawal ibrahimlawal

View GitHub Profile
@ibrahimlawal
ibrahimlawal / PaystackTransactionsFetcher-usage.js
Last active August 1, 2019 12:09
Get a list of transactions from Paystack
const paystackTransactionsFetcher = require('./PaystackTransactionsFetcher');
paystackTransactionsFetcher.fetch({
secretKey: 'sk_live_youwishiwereavalidkey___', // secret key
perPage: 100, // leave empty to fetch 50 per page
status: 'all', // leave empty to fetch only successful
startFrom: new Date('2011-01-01'), // Leave empty to fetch only a week ago
})
.then((i) => { console.log(JSON.stringify(i, null, 2)); })
.catch(console.error);
@ibrahimlawal
ibrahimlawal / Git Scripts for speedy delivery.md
Last active April 12, 2021 15:20
Git Scripts for speedy delivery

Creating the executable files

Create new files with the names below in a folder that is on your PATH. The sample command below uses the default editor to open such in your default editor. Likely TextEdit.

$ open -e /usr/local/bin/git-mrm /usr/local/bin/git-ddev
@ibrahimlawal
ibrahimlawal / validateCardNumber.php
Last active June 12, 2024 07:19
Validate card numbers using Regex and a Luhn Check
<?php
class Operations {
const PATTERN_AMERICAN_EXPRESS = "/^3[47][0-9]{13}$/";
const PATTERN_DINERS_CLUB = "/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/";
const PATTERN_DISCOVER = "/^6(?:011|5[0-9]{2})[0-9]{12}$/";
const PATTERN_JCB = "/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/";
const PATTERN_MASTERCARD = "/^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/";
const PATTERN_VERVE = "/^((506(0|1))|(507(8|9))|(6500))[0-9]{12,15}$/";