Skip to content

Instantly share code, notes, and snippets.

View twmbx's full-sized avatar
🇿🇲

Twaambo Haamucenje twmbx

🇿🇲
View GitHub Profile
@brianwebb01
brianwebb01 / foreman-sample.json
Created February 25, 2014 02:21
Sample Foreman template to follow hexagonal architecture found here: http://git.io/9NY65w
{
"structure": {
"copy": [
{
"from": "/projects/hex-arch-laravel/app/lib/Contracts/Instances/InstanceInterface.php",
"to": "app/lib/Contracts/Instances/InstanceInterface.php"
},
{
"from": "/projects/hex-arch-laravel/app/lib/Contracts/Notification/CreatorInterface.php",
"to": "app/lib/Contracts/Notification/CreatorInterface.php"
@clouddueling
clouddueling / routes.php
Created February 27, 2013 22:48
username in url laravel
Event::listen('404', function()
{
$username = URI::segment(1);
$user = User::where_username($username)
->where_type('account')
->first();
if ($user != null) {
if ($user->username != '') {
@smaboshe
smaboshe / datasheet.md
Created June 6, 2012 06:22
MTN Zambia Mobile Internet Data Sheet

MTN Zambia Mobile Internet Data Sheet

Here is a summary of mobile Internet bundles offered by MTN Zambia. For corrections and updates get in touch at Pencil Case Studios.

To access the data purchase menu use USSD code *335#.

Data Bundle
@smaboshe
smaboshe / datasheet.md
Created June 6, 2012 05:54
Airtel Zambia Mobile Internet Data Sheet

Airtel Zambia Mobile Internet Data Sheet

Here is a summary of mobile Internet bundles offered by Airtel Zambia. To purchase data bundles, use USSD code *575# and follow the instructions.

For corrections and updates get in touch at Pencil Case Studios.

@smaboshe
smaboshe / datasheet.md
Created May 2, 2012 07:07
Zamtel Mobile Internet Data Sheet

Zamtel Mobile Internet Data Sheet

Here is a summary of mobile Internet bundles offered by Zamtel. If you are like me and can never remember the USSD codes, feel free to use this as a reference.

To check how much data you have left on a bundle use USSD *323#.

For corrections and updates get in touch at Pencil Case Studios.

@daverockz
daverockz / ussdAppSample.php
Created December 4, 2016 23:26
sample php ussd app
<?php
$ussdRequest = json_decode(@file_get_contents('php://input'));
$ussdResponse = new stdclass;
if ($ussdRequest != NULL)
switch ($ussdRequest->Type) {
case 'Initiation':
$ussdResponse->Message =
<?php
$ussdRequest = json_decode(@file_get_contents('php://input'));
if($ussdRequest != NULL);
$ussdResponse = new stdClass;
switch($ussdRequest->Type){
case "Initiation":
<?php
date_default_timezone_set('Africa/Nairobi');
// set up db connection
include("connection.php")
$TenantTransactionId = $_GET["TransactionType"];
$SESSIONID = $_GET["SESSIONID"];
$SERVICECODE = $_GET["SERVICECODE"];
$ApplicationID = $_GET["ApplicationID"];
$USSD_string = $_GET["USSD_string"];
@noeldiaz
noeldiaz / gist:0f9a2583a41579878764
Created July 18, 2014 15:56
Homestead 32-bit Version
## Making a 32 bit version of Homestead
# Clone the settler repository to a directory
git clone https://github.com/laravel/settler.git Ubuntu32
# In that directory edit the file called "Vagrantfile" to use a ubuntu 32 box instead of the 64 bit one
change this line:
config.vm.box = "ubuntu/trusty64"
@fideloper
fideloper / Gettable.php
Created March 9, 2014 19:33
Trait for making protected/private attributes "gettable", leaving "setting" the attributes a matter of business logic to be implemented.
<?php
trait Gettable {
/**
* Retrieve private attributes.
* Attributes should be protected
* so they cannot be *set* arbitrarily.
* This allows us to *get* them as if they
* were public.