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
#include <iostream>
using namespace std;
class human {
public:
string name;
int age;
void eat () {
cout << name <<" is eating" << endl;
#include <iostream>
using namespace std;
class human {
public:
string name;
int age;
void eat () {
cout << name <<" is eating" << endl;
<?php
$request = $_SERVER['REDIRECT_URL'];
switch ($request) {
case '/' :
require __DIR__ . '/views/index.php';
break;
case '' :
require __DIR__ . '/views/index.php';
@ichtrojan
ichtrojan / reload.js
Created May 10, 2019 14:31
Reload a Page after first load
(() => {
if( window.localStorage )
{
if(!localStorage.getItem('firstLoad'))
{
localStorage['firstLoad'] = true;
window.location.reload();
} else {
localStorage.removeItem('firstLoad');
}
package main
import (
"github.com/gorilla/mux"
"html/template"
"log"
"net/http"
)
func main () {
@ichtrojan
ichtrojan / README.md
Created January 31, 2020 08:50 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@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 / Quicksort.php
Last active May 29, 2020 13:11
Quicksort
<?php
function generateArray()
{
$array = [];
for ($i = 0; $i < 11; $i++) {
$array[$i] = mt_rand(-100, 100);
}
server {
root /var/www/{project}/build;
server_name domain.com;
location ~* ^.+\.(ico|gif|jpg|jpeg|png)$ {
access_log off;
expires 30d;
}
server {
server_name your_domain www.your_domain;
location / {
proxy_pass http://localhost:9990;
}
}