Skip to content

Instantly share code, notes, and snippets.

View afiqiqmal's full-sized avatar
👻
I may be slow to respond.

Hafiq afiqiqmal

👻
I may be slow to respond.
View GitHub Profile
@landbryo
landbryo / laragon-cmder-phpstorm.md
Created August 21, 2020 16:56
Laragon Cmder in PHPStorm

Navigate to PHPStorm's Settings > Tools > Terminal and set...

Shell path "cmd" /k "C:\laragon\bin\cmder\vendor\init.bat"

@ishad0w
ishad0w / sources.list
Created April 30, 2020 16:55
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
@afiqiqmal
afiqiqmal / default.conf
Last active March 30, 2020 02:02
NGINX Laravel Config
server {
listen 80;
listen [::]:80;
proxy_http_version 1.1;
proxy_set_header Connection "";
root /PROJECT_PATH/public;
index index.html index.htm index.php index.nginx-debian.html;
@afiqiqmal
afiqiqmal / pre-commit
Last active March 24, 2020 04:03
Pre commit Versioning
#!/bin/sh
if ! type "jq" > /dev/null; then
echo "Please install jq command to commit. run command 'brew install jq'"
exit 1
fi
currentVersion=$(jq .version .version.json | bc -l)
currentBuildNumber=$(jq .build_number .version.json | bc -l)
@afiqiqmal
afiqiqmal / ModelRouteUrlGenerator.php
Last active April 22, 2019 04:23
Leverage Eloquent To Prepare Your URLs LARAVEL
<?php
/**
* Created by PhpStorm.
* User: hafiq
* Date: 21/04/2019
* Time: 7:17 PM
*/
namespace App\Http\Traits;
@poing
poing / laravel_facades.md
Last active March 25, 2024 21:37
Laravel Facades

Understanding Facades in Laravel

What's a Facade?

The Laravel explination, shown below is confusing.

Facades provide a "static" interface to classes that are available in the application's service container. Laravel ships with many facades which provide access to almost all of Laravel's features. Laravel facades serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.

Many examples use Cache::get('key') to demonstrate how a Facade works. Comparing the following code to the utility that a Facade provides.

@afiqiqmal
afiqiqmal / jsgrid-custom.js
Last active November 7, 2019 07:51
Boilderplate for JSGrid Library
$(function () {
"use strict";
jsGrid.setDefaults({
tableClass: "jsgrid-table table table-striped table-hover"
});
jsGrid.setDefaults("text", {
_createTextBox: function() {
return $("<input>").attr("type", "text").attr("class", "form-control input-sm")
@afiqiqmal
afiqiqmal / SoapRequest.php
Last active August 8, 2019 12:08
Soap Request Using PHP which focus on SOAP using WSSE Security and Basic Authenticattion
<?php
/**
* Created by PhpStorm.
* User: hafiq
* Date: 28/02/2018
* Time: 9:30 AM
*/
namespace App\Library;
@nasrulhazim
nasrulhazim / MinifyHtml.php
Created February 25, 2018 12:29
Minify HTML
<?php
namespace App\Http\Middleware;
use Closure;
class MinifyHtml
{
/**
* Handle an incoming request.
@rohankhudedev
rohankhudedev / opcache.ini
Last active April 19, 2024 09:56
Best Zend OpCache Settings / Tuning / Configurations
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=1
; The OPcache shared memory storage size.
opcache.memory_consumption=512