Skip to content

Instantly share code, notes, and snippets.

View niilante's full-sized avatar
🌊
I'm a builder more than a Mason

Richard Nii Lante Lawson niilante

🌊
I'm a builder more than a Mason
View GitHub Profile
@niilante
niilante / active_nav_tag.py
Created July 19, 2021 15:02 — forked from RoboAndie/active_nav_tag.py
Django template tag to highlight the active navigation item
@register.simple_tag(takes_context=True)
def active_nav(context, pattern_or_urlname, is_sr_text=False):
path = context['request'].path
if ',' in pattern_or_urlname:
patterns_to_try = pattern_or_urlname.split(',')
else:
patterns_to_try = [pattern_or_urlname]
for pattern in patterns_to_try:
try:
p = '^' + reverse(pattern)
@niilante
niilante / FileUploader.php
Created September 12, 2021 20:52 — forked from syofyanzuhad/FileUploader.php
Laravel Trait for uploading Images / Photos
<?php
namespace App\Traits;
use Illuminate\Support\Facades\Storage;
trait FileUploader
{
/**
* For Upload Images.
@niilante
niilante / FormRequest.php
Created September 12, 2021 20:55 — forked from syofyanzuhad/FormRequest.php
change your default extends FormRequest to your customize FormRequest (API ONLY)
<?php
namespace App\Http\Requests\Api;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Validation\ValidationException;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Foundation\Http\FormRequest as LaravelFormRequest;
@niilante
niilante / githubpull.md
Created January 4, 2022 04:51 — forked from Jabarabo/githubpull.md
Gist of a stolen gist
@niilante
niilante / install_php7.4.x_with_pthreads.md
Created January 4, 2022 04:52 — forked from pointybeard/install_php7.4.x_with_pthreads.md
Compiling PHP 7.4.x with pthreads enabled

Compiling PHP 7.4.x with pthreads (https://github.com/pmmp/pthreads) enabled

Install required libraries

build-essential autoconf libtool bison re2c pkg-config git-core libsqlite3-dev libonig-dev libzip-dev libltdl-dev libbz2-dev libxml2-dev libxslt1-dev libssl-dev libicu-dev libpspell-dev libenchant-dev libmcrypt-dev libpng-dev libjpeg8-dev libfreetype6-dev libmysqlclient-dev libreadline-dev libcurl4-openssl-dev

Download PHP 7.4.x source

cd /var/sources

wget https://www.php.net/distributions/php-7.4.24.tar.gz

# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# You can specify a custom docker image from Docker Hub as your build environment.
# run composer check-platform-reqs for a list of required extensions.
image: php:7.2-fpm
pipelines:
default:
# Not needed unless you're doing feature tests.
# - step:
@niilante
niilante / awesm.md
Created January 4, 2022 05:11 — forked from matula/awesm.md
Awesome PHP stuff in one Gist