Skip to content

Instantly share code, notes, and snippets.

View bosunski's full-sized avatar
:octocat:
Sleeping Here!

Bosun Egberinde bosunski

:octocat:
Sleeping Here!
View GitHub Profile
{
"event": "charge.success",
"data": {
"id": 84,
"domain": "test",
"status": "success",
"reference": "9cfbae6e-bbf3-5b41-8aef-d72c1a17650g",
"amount": 50000,
"message": null,
"gateway_response": "Approved",
@bosunski
bosunski / server.php
Created October 18, 2019 14:48 — forked from IvanChepurnyi/server.php
Simple multi-process ReactPHP server with workers control
<?php
/**
* Copyright © EcomDev B.V. All rights reserved.
* See LICENSE.txt for license details.
*/
declare(strict_types=1);
$port = $argv[1];
$serverName = $argv[2];
@font-face {
font-family: "Brandon Text";
src: url(/assets/fonts/BrandonText-Regular.woff2);
}
@font-face {
font-family: Brandon Text;
src: url("/assets/fonts/BrandonText-Light.woff2") format("woff2"), url("/assets/fonts/BrandonText-Light.woff") format("woff");
font-weight: 300;
font-style: normal
gist token=1d177d749a5d57a8676fa77f737892c285eb1376
gist id=a53f646ca33cd140560d78eeed5a9c5b
@bosunski
bosunski / closure_callable.php
Created June 13, 2019 15:17
A brief explannation of Callables and Closures.
<?php
// An Anonymous Class or Normal Classes
$class = new class {
public function method() {
echo 'In a Class!', PHP_EOL;
}
};
// We can write this ... 🤔
$arrayLikeCallable = [new $class, 'method'];
@bosunski
bosunski / promise.php
Last active June 11, 2019 22:40
Describes a Promise
<?php
class Promise {
private $resolvedStack = [];
private $catches = [];
public function then(callable $resolved): Promise
{
array_push($this->resolvedStack, $resolved);
}
@bosunski
bosunski / homebrew-permissions-issue.md
Created February 13, 2019 19:25 — forked from irazasyed/homebrew-permissions-issue.md
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*

<?php
$fileCache = "LastLine.txt";
$oldLastLine = getLastLine($fileCache);
function getLastLine($cachePath)
{
if (file_exists($cachePath))
return file_get_contents($cachePath);
return 0;
@bosunski
bosunski / Wisdom.md
Last active January 18, 2019 00:10

The Lucid Architecture for Laravel was introduced by Abed Halawi in one of the Laracon event and it grants a laravel app a good way to scale the app in terms of the development flexibility. The architecture follows a Domain Driven design approach.

However, even though Lucid Architecture provides a way you can create a fresh project with Lucid, it's quite difficult to implement on an already running project that wants to try out the Structure. the purpose of this article is to take you through how we can still use Lucid in a well ordered manner without it affecting you app initial setup.

This post is written for as many who will like to implement this clear and simple architecture in their laravel project.

We're going to achieve this in few steps, so follow me tightly:

@bosunski
bosunski / Laravel-Container.md
Created October 30, 2018 23:01
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).