Skip to content

Instantly share code, notes, and snippets.

View manuelgeek's full-sized avatar
😎
#mANuEl💯

Magak Emmanuel manuelgeek

😎
#mANuEl💯
View GitHub Profile
@manuelgeek
manuelgeek / index.php
Created February 27, 2018 08:59 — forked from abel-masila/index.php
A simple USSD registration application written in PHP
<?php
/* Simple sample USSD registration application
* USSD gateway that is being used is Africa's Talking USSD gateway
*/
// Print the response as plain text so that the gateway can read it
header('Content-type: text/plain');
/* local db configuration */
$dsn = 'mysql:dbname=dbname;host=127.0.0.1;'; //database name
git clone https://github.com/manuelgeek/gtt_api
create .env file in tje root folder of the project, copy contents in .env.example and paste in .env
create a db, name it gtt_test, or any name you want
then chage the db credential in the .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
use Illuminate\Support\ServiceProvider;
public function boot()
{
Schema::defaultStringLength(191);
}
1. header set
Api-Key = 12345safety
Content-type = application/json
if empty
{
"success": false,
"message": "No Api Key set, Access Denied"
}
2. POST /api/add_rating
@manuelgeek
manuelgeek / pagination.css
Created April 27, 2018 09:41 — forked from bogvsdev/pagination.css
Bootstrap's pagination styles
.pagination{height:36px;margin:0;padding: 0;}
.pager,.pagination ul{margin-left:0;*zoom:1}
.pagination ul{padding:0;display:inline-block;*display:inline;margin-bottom:0;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}
.pagination li{display:inline}
.pagination a{float:left;padding:0 12px;line-height:30px;text-decoration:none;border:1px solid #ddd;border-left-width:0}
.pagination .active a,.pagination a:hover{background-color:#f5f5f5;color:#94999E}
.pagination .active a{color:#94999E;cursor:default}
.pagination .disabled a,.pagination .disabled a:hover,.pagination .disabled span{color:#94999E;background-color:transparent;cursor:default}
.pagination li:first-child a,.pagination li:first-child span{border-left-width:1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}
.pagination li:last-child a{-webkit-border-radius:0 3px 3px 0;
@manuelgeek
manuelgeek / Updating Sublime Text
Created May 30, 2018 13:10
Updating Sublime Text on Ubuntu
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer
sudo apt-get install sublime-text
@if (Session::has('success'))
<div class="alert alert-success" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
{{ Session::get('success')}}
</div>
@endif
@if (Session::has('error'))
@manuelgeek
manuelgeek / ext-mcrypt
Created June 14, 2018 07:01
add ext-mcrypt to php 7.2 ubuntu
https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
I was just watching a friend of mine work with git, and he'd always type all the git commands in full, like git status and git push. I realized that he must not be the only one to do so, so I decided to write this quick blog post and encourage everyone to create Huffman coded aliases for the most commonly used commands. Instead of typing git status, alias it to gs. Instead of git add, alias it to ga, etc.
Here are a bunch of aliases that I created for 99% of git commands I ever use:
alias ga='git add'
alias gp='git push'
alias gl='git log'
alias gs='git status'
alias gd='git diff'
alias gdc='git diff --cached'
@manuelgeek
manuelgeek / MailChimpController.php
Last active February 13, 2019 23:32
a simple subscription code with Laravel 5.6 and MailChimp
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Auth;
use Config;