Skip to content

Instantly share code, notes, and snippets.

View ladaposamuel's full-sized avatar
🐝
buzzzz

Samuel Ladapo ladaposamuel

🐝
buzzzz
  • Lagos , Nigeria
View GitHub Profile
@ladaposamuel
ladaposamuel / keybase.md
Created August 29, 2023 22:12
keybase.md

Keybase proof

I hereby claim:

  • I am ladaposamuel on github.
  • I am samuelladapo (https://keybase.io/samuelladapo) on keybase.
  • I have a public key ASCwZslojtOD0XeJGPo8kRr4SI-gWqMaIhLF5kDlbuIo1Ao

To claim this, I am signing this object:

[
"Akínyẹmí",
"Awóyọmí",
"Adélóun",
"Adélóhun",
"Abíọ́lá",
"Ayìnbọ́",
"Alọ́móge",
"Agbógunlérí",
"Akínyọọ́lá",
@ladaposamuel
ladaposamuel / git-deployment.md
Created January 30, 2018 16:59 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

@ladaposamuel
ladaposamuel / number_unformat.php
Created January 30, 2018 11:05 — forked from msng/number_unformat.php
Unformats a number formatted with number_format().
<?php
function number_unformat($number, $force_number = true, $dec_point = '.', $thousands_sep = ',') {
if ($force_number) {
$number = preg_replace('/^[^\d]+/', '', $number);
} else if (preg_match('/^[^\d]+/', $number)) {
return false;
}
$type = (strpos($number, $dec_point) === false) ? 'int' : 'float';
$number = str_replace(array($dec_point, $thousands_sep), array('.', ''), $number);
settype($number, $type);
@ladaposamuel
ladaposamuel / ubuntu_agnoster_install.md
Created January 28, 2018 15:15 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@ladaposamuel
ladaposamuel / passes.php
Last active October 26, 2017 13:19
Laravel Validation rule for bitcoin adress
public function passes($attribute, $address)
{
$decoded = decodeBase58($address);
$d1 = hash("sha256", substr($decoded,0,21), true);
$d2 = hash("sha256", $d1, true);
if(substr_compare($decoded, $d2, 21, 4)){
return false;
@ladaposamuel
ladaposamuel / ValidateBtcAddress.php
Last active October 26, 2017 12:59
ValidateBtcAddress.php
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
class ValidateBtcAddress implements Rule
{
/**
* Create a new rule instance.
@ladaposamuel
ladaposamuel / php
Last active October 26, 2017 12:54
decodeBase58.php
function decodeBase58($input) {
$alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
$out = array_fill(0, 25, 0);
for($i=0;$i<strlen($input);$i++){
if(($p=strpos($alphabet, $input[$i]))===false){
return false;
}
$c = $p;
for ($j = 25; $j--; ) {
@ladaposamuel
ladaposamuel / sql
Last active October 24, 2017 08:50
Nigerian Banks in an insert sql query
INSERT INTO `bank_names`(`bank_name`)
VALUES
('Access Bank'),
('Citibank'),
('Diamond Bank'),
('Dynamic Standard Bank'),
('Development Financial Pruben Bank'),
('Ecobank Nigeria'),
('Fidelity Bank Nigeria'),
('First Bank of Nigeria'),
@ladaposamuel
ladaposamuel / bbcode.php
Created December 5, 2015 22:56 — forked from neo22s/bbcode.php
BBcode parser example
<?php
/**
* BBcode helper class
*
* @package BBcode
* @category Helper
* @author Chema <chema@garridodiaz.com>
* @copyright (c) 2012
* @license GPL v3
*/