Skip to content

Instantly share code, notes, and snippets.

I'm Feeling Lucky!

Moses Ndeda ratatatKE

I'm Feeling Lucky!
  • Kenya
Block or report user

Report or block ratatatKE

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
NimzyMaina / kra_pin_regex.php
Last active Jun 21, 2019
Regex to validate KRA PIN
View kra_pin_regex.php
$kra_regex = "/^[A]{1}[0-9]{9}[a-zA-Z]{1}$/";
$kra_pin = "A001234567J";
if(preg_match($kra_regex, $kra_pin)){
echo "Success! Valid KRA PIN";
echo "Error! Invalid KRA PIN";
shov / links.txt
Created Jan 22, 2019
XDebug on laradock
View links.txt
muya / random_saf_ke_msisdn_faker.php
Last active Apr 6, 2017
Code for creating random Safaricom Kenya Phone numbers (accompanying blog post:
View random_saf_ke_msisdn_faker.php
// include Faker in your project (
use Faker\Factory as Faker;
$faker = Faker::create();
$regex = "/(\+?254|0){1}[7]{1}([0-2]{1}[0-9]{1}|[9]{1}[0-2]{1})[0-9]{6}/";
$samplePhoneNumber = $faker->regexify($regex);
muya / msisdn_regex.txt
Created Feb 28, 2016
Regex for Safaricom Kenya, Airtel Kenya & Tigo Tanzania Phone Numbers
View msisdn_regex.txt
# KE
SAFARICOM: "/(\+?254|0|^){1}[-. ]?[7]{1}([0-2]{1}[0-9]{1}|[9]{1}[0-2]{1})[0-9]{6}\z/"
AIRTEL: "/(\+254|0|^){1}[-. ]?[7]{1}([3]{1}[0-9]{1}|[8]{1}[5-9])[0-9]{6}\z/"
# TZ
TIGO: "/(\+?255|0|^){1}[-. ]?([7]{1}[1]{1}[2-9]{1}|[6]{1}[57]{1}[2-9]{1})[0-9]{6}\z/"
lesiki / fsmswebconnection.php
Last active Apr 24, 2019
PHP sample code for sending SMS through the FrontlineCloud API
View fsmswebconnection.php
<?php //FILE: sms_api.php
function sendSMS($number, $message) {
$url = "example"; // Set your frontlinesms or frontlinecloud webconnection url here
$secret = "secret"; // Set the secret here
$request = array(
'secret' => $secret,
'message' => $message,
'recipients' => array(array(
You can’t perform that action at this time.