Skip to content

Instantly share code, notes, and snippets.

View tha-ninja's full-sized avatar

tha-ninja

View GitHub Profile
{
"countries": [
{
"country": "Afghanistan",
"states": ["Badakhshan", "Badghis", "Baghlan", "Balkh", "Bamian", "Daykondi", "Farah", "Faryab", "Ghazni", "Ghowr", "Helmand", "Herat", "Jowzjan", "Kabul", "Kandahar", "Kapisa", "Khost", "Konar", "Kondoz", "Laghman", "Lowgar", "Nangarhar", "Nimruz", "Nurestan", "Oruzgan", "Paktia", "Paktika", "Panjshir", "Parvan", "Samangan", "Sar-e Pol", "Takhar", "Vardak", "Zabol"]
},
{
"country": "Albania",
"states": ["Berat", "Dibres", "Durres", "Elbasan", "Fier", "Gjirokastre", "Korce", "Kukes", "Lezhe", "Shkoder", "Tirane", "Vlore"]
},
@tha-ninja
tha-ninja / kenyan-counties.php
Created March 20, 2021 16:35 — forked from crushcafeteria/kenyan-counties.php
PHP array of all the 47 counties of Kenya. Useful for populating dropdowns
<?php
#############################################################
# 47 counties of Kenya #
#############################################################
$config['counties'] = [
'BARINGO' => 'Baringo County',
'BOMET' => 'Bomet County',
'BUNGOMA' => 'Bungoma County',
'BUSIA' => 'Busia County',
'ELGEYO-MARAKWET' => 'Elgeyo-Marakwet County',
@tha-ninja
tha-ninja / kenya-counties.html
Last active November 15, 2020 17:53 — forked from nixoncode/kenya-counties.html
Kenya counties select drop down menu in html arrange in alphabetical order
<select>
<option value="baringo">Baringo</option>
<option value="bomet">Bomet</option>
<option value="bungoma">Bungoma</option>
<option value="busia">Busia</option>
<option value="elgeyo marakwet">Elgeyo Marakwet</option>
<option value="embu">Embu</option>
<option value="garissa">Garissa</option>
<option value="homa bay">Homa Bay</option>
<option value="isiolo">Isiolo</option>
<table id="datatable-buttons" class="table table-striped table-bordered">
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jan 13, 2020 at 09:25 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
<?php
public function process($amount,$phone,$account)
{
$phone2= '254'.substr($phone, 1);
$path = url('callback_url');
$url = 'https://api.safaricom.co.ke/mpesa/stkpush/v1/processrequest';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
$token=$this->generate_token();
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json','Authorization:Bearer '.$token)); //setting custom header
/* Import SDK classes */
import com.africastalking.Callback;
import com.africastalking.AfricasTalking;
import com.africastalking.PaymentService;
import com.africastalking.payment.response.WalletBalanceResponse;
import java.util.HashMap;
import java.util.List;
import java.io.IOException;
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use PHPMailer\PHPMailer\PHPMailer;
class MailController extends Controller
{
//
<style type="text/css">
@media screen and (min-width:768px){
.navbar-brand-centered {
position: absolute;
left: 50%;
display: block;
width: 160px;
text-align: center;
background-color: #eee;
}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Active Customers</title>
<style type="text/css">
/* reset */
*