Skip to content

Instantly share code, notes, and snippets.

View ichtrojan's full-sized avatar
🔺
The Nothing

Michael Okoh ichtrojan

🔺
The Nothing
View GitHub Profile
@ichtrojan
ichtrojan / AppServiceProvider.php
Created April 11, 2020 15:37 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@ichtrojan
ichtrojan / README.md
Created January 31, 2020 08:50 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@ichtrojan
ichtrojan / asynchronous.js
Created April 10, 2018 10:30 — forked from joepie91/asynchronous.js
PHP vs Node.js: Synchronous vs Asynchronous
console.log("Before the first file is read.");
hypotheticalFileGetContents("sample.txt", function(fileContents){
// fileContents now contains the file contents, this function is only called when the file read in the background has finished
console.log("After the first file has completed reading.");
});
// You've now told it to start the first read, but it won't 'block' your script execution. It will do the read in the background, and immediately move on with the rest of your code.
console.log("Before the second file is read.");
hypotheticalFileGetContents("sample2.txt", function(fileContents){