Skip to content

Instantly share code, notes, and snippets.

View ibrahimlawal's full-sized avatar

Ibrahim Lawal ibrahimlawal

View GitHub Profile
@ibrahimlawal
ibrahimlawal / install-wp.sh
Last active October 27, 2016 11:17 — forked from BFTrick/install-wp.sh
Download & Install WordPress via Curl
curl -O https://wordpress.org/latest.zip
unzip latest.zip
mv wordpress wp
rm latest.zip
@ibrahimlawal
ibrahimlawal / README.md
Last active October 23, 2016 08:27 — forked from jonathantneal/README.md
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@ibrahimlawal
ibrahimlawal / PaystackFees.php
Last active April 6, 2020 00:57
A php class to add paystack's local charge to a transaction total. Totally flops if the user pays with a foreign card.
<?php
class PaystackFees
{
const DEFAULT_PERCENTAGE = 0.015;
const DEFAULT_ADDITIONAL_CHARGE = 10000;
const DEFAULT_THRESHOLD = 250000;
const DEFAULT_CAP = 200000;
public static $default_percentage = PaystackFees::DEFAULT_PERCENTAGE;
@ibrahimlawal
ibrahimlawal / paystack-subscription-disable.php
Last active July 16, 2016 04:04
Enable or disable Paystack subscriptions in PHP, knowing the token and code // Uses Paystack Class : https://github.com/yabacon/paystack-class
<?php
// Get this from https://github.com/yabacon/paystack-class
require 'Paystack.php';
$paystack = new Paystack('sk_test_xxx');
// ... some code previously to obtain $token and $code for this subscription
// (both can be obtained by capturing `subscription.create` event)
// the code below throws an exception if there was a problem completing the request,
// else returns an object created from the json response
@ibrahimlawal
ibrahimlawal / paystack-transaction-initialize.php
Last active December 17, 2020 13:54
Initializing a Paystack Transaction for 20 naira // And verifying it. // Uses Paystack Class : https://github.com/yabacon/paystack-class
<?php
// Get this from https://github.com/yabacon/paystack-class
require 'Paystack.php';
$paystack = new Paystack('sk_test_xxx');
// the code below throws an exception if there was a problem completing the request,
// else returns an object created from the json response
$trx = $paystack->transaction->initialize(
@ibrahimlawal
ibrahimlawal / sample.php
Created May 25, 2016 10:28
Sample lines for creating mail headers PHP
<?php
// plain text
$headers = "MIME-Version: 1.0\r\n";
$headers.= "From: =?utf-8?Q?" . quoted_printable_encode("Remaayo Int'l Guest House Limited") . "?= <info@remintguesthouseltd.com.ng>\r\n";
$headers.= "Content-Type: text/plain;charset=utf-8\r\n";
$headers.= "X-Mailer: PHP/" . phpversion();
// html
$headers = "MIME-Version: 1.0\r\n";
@ibrahimlawal
ibrahimlawal / verify-and-handle-paystack-event.php
Last active June 22, 2022 22:17
Paystack Webhook Code Skeleton, PHP
<?php
if ((strtoupper($_SERVER['REQUEST_METHOD']) != 'POST' ) || !array_key_exists('HTTP_X_PAYSTACK_SIGNATURE', $_SERVER) ) {
// only a post with paystack signature header gets our attention
exit();
}
// Retrieve the request's body
$input = @file_get_contents("php://input");
define('PAYSTACK_SECRET_KEY','sk_xxxx_xxxxxx');
@ibrahimlawal
ibrahimlawal / 404.blade.php
Created April 21, 2016 12:14
Custom Laravel 404.blade.php that includes default error details
<!DOCTYPE html>
<html>
<head>
<title>Custom Laravel 404.blade.php that includes default error details</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" >
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
background-color: #eee;
}
@ibrahimlawal
ibrahimlawal / disposable-email-provider-domains
Created April 6, 2016 13:44
List of disposable email provider domains
0815.ru
0wnd.net
0wnd.org
10minutemail.co.za
10minutemail.com
123-m.com
126.com
139.com
163.com
1fsdfdsfsdf.tk
@ibrahimlawal
ibrahimlawal / TLSSocketFactory.java
Last active November 11, 2018 21:53 — forked from fkrauthan/TLSSocketFactory.java
**A fork** Custom SSLSocketFactory Implementation to enable tls 1.2 for android 4.1 (16+) - modified to get system default TrustManagers and for use with retrofit 2 and okHttp 3.1.2;
package co.paystack.android.api.utils;
/**
* Created by ibrahimlawal on Mar/14/2016.
*
* @author fkrauthan
* @see http://blog.dev-area.net/2015/08/13/android-4-1-enable-tls-1-1-and-tls-1-2/
* @since 1.2.0
*
* Modified to work with okHttp3.1.2