Skip to content

Instantly share code, notes, and snippets.

Avatar
🇳🇬
Learning something new somewhere!

Elisha Ukpong elishaukpong

🇳🇬
Learning something new somewhere!
View GitHub Profile
View PHP8 new features example
<?php
//NULLSAFE OPERATOR
//class User {
// public function profile(){
// return new Profile;
// }
//}
//
View MeetupJam
<!--
Copyright 2018 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
View Docker-Lumen
version: '2'
services:
##
# Autodiscovery : Consul
##
autodiscovery:
build: ./autodiscovery/
mem_limit: 128m
expose:
- 53
View Linked List
<?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class ListNode {
@elishaukpong
elishaukpong / UpCommand.php
Created Jul 21, 2020
Bring the application out of maintenance mode
View UpCommand.php
<?php
namespace Illuminate\Foundation\Console;
use Exception;
use Illuminate\Console\Command;
class UpCommand extends Command
{
/**
@elishaukpong
elishaukpong / CheckForMaintenanceMode.php
Last active Jul 21, 2020
Laravel's default check for maintenance middleware class
View CheckForMaintenanceMode.php
app/Http/Middleware/CheckForMaintenanceMode.php
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
class CheckForMaintenanceMode extends Middleware
{
@elishaukpong
elishaukpong / DownCommand.php
Created Jul 21, 2020
Laravel's down command class
View DownCommand.php
<?php
namespace Illuminate\Foundation\Console;
use Exception;
use Illuminate\Console\Command;
use Illuminate\Support\InteractsWithTime;
class DownCommand extends Command
{
View three.js starter
// Remember to bring in three.js and here is the script for the trackball controls as well:
// https://cdn.rawgit.com/mrdoob/three.js/dev/examples/js/controls/TrackballControls.js
//RENDERER
const renderer = new THREE.WebGLRenderer({
canvas: document.getElementById('canvas'),
antialias: true
});
renderer.setClearColor(0x25c8ce);
renderer.setPixelRatio(window.devicePixelRatio);
View Preloader JS
// PRELOADER
var width = 100,
perfData = window.performance.timing, // The PerformanceTiming interface represents timing-related performance information for the given page.
EstimatedTime = -(perfData.loadEventEnd - perfData.navigationStart),
time = parseInt((EstimatedTime / 1000) % 60, 10) * 100;
var PercentageID = $("#percentage"),
start = 0,
end = 100,
durataion = time;
View installing_rmagick_ubuntu_16.04.txt
# the instructions from here: https://stackoverflow.com/questions/3704919/installing-rmagick-on-ubuntu/31089915#31089915
# worked, but only after I added in line 8
sudo apt-get purge graphicsmagick graphicsmagick-dbg imagemagick-common imagemagick imagemagick-6.q16 libmagickcore-6-headers libmagickwand-dev graphicsmagick-libmagick-dev-compat
sudo apt-get autoremove
sudo apt-get install imagemagick libmagickwand-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config /usr/bin/Magick-config
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
gem install rmagick