Skip to content

Instantly share code, notes, and snippets.

View nmfzone's full-sized avatar
🍿
I'm hungry

Nabil Muhammad Firdaus nmfzone

🍿
I'm hungry
View GitHub Profile
@nmfzone
nmfzone / gist:088f976af0d9bf557228d5b089c3ff19
Created May 18, 2022 02:45 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@nmfzone
nmfzone / Readme.md
Last active February 15, 2021 02:16
Extending Laravel Illuminate\Routing\Router
  1. Extend the Illuminate\Routing\Router to the (for example) App\Illuminate\Routing\Router.
  2. Add method setMiddleware and setMiddlewareGroups to your App\Illuminate\Routing\Router
<?php

namespace App\Illuminate\Routing;

use Illuminate\Routing\Router as BaseRouter;
@nmfzone
nmfzone / TestCommand.php
Created February 6, 2021 19:07
Start http server before Laravel Test
<?php
namespace App\Console\Commands;
use Dotenv\Dotenv;
use Exception;
use Illuminate\Console\Command;
use Illuminate\Support\Arr;
use RuntimeException;
use Symfony\Component\Process\Exception\ProcessSignaledException;
@nmfzone
nmfzone / index.php
Last active January 19, 2021 00:33
Get Start Date and End Date every weeks in a month with Carbon
<?php
public function getWeeks(int $month, int $year = null): array {
$year = is_null($year) ? Carbon::now()->year : $year;
$date = Carbon::createFromFormat('Y-m', $year . '-' . $month)
->firstOfMonth();
$oDate = $date->copy();
$data = [];
@nmfzone
nmfzone / index.html
Created December 15, 2020 23:16
Simple Calculator (HTML + CSS + Javascript)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Calculator</title>
<style>
@nmfzone
nmfzone / fastcgi-php.conf
Created May 8, 2020 15:34
NginX Config for Multi Tenant Sites
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
@nmfzone
nmfzone / .phpcs.xml
Last active July 29, 2022 15:42
Intellij IDEA Laravel Configuration
<?xml version="1.0"?>
<ruleset name="Laravel Code Standard" namespace="Laravel\CS\Standard">
<description>Code Standard used for Laravel App</description>
<file>./app</file>
<file>./routes</file>
<exclude-pattern>./bootstrap/*</exclude-pattern>
<exclude-pattern>./config/*</exclude-pattern>
<exclude-pattern>./database/*</exclude-pattern>
@nmfzone
nmfzone / head
Created March 25, 2020 23:04
Experiencing slow curl Connection on DigitalOcean Droplets (Ubuntu 16.04)
########## DO NOT INCLUDE THIS ##########
# File Location: /etc/resolvconf/resolv.conf.d/head
#########################################
nameserver 8.8.8.8
nameserver 8.8.4.4
@nmfzone
nmfzone / celery-beat-appcom.conf
Last active October 27, 2020 06:34
Django Production Simple Configuration using Supervisor + Gunicorn + Celery + Flower + Pyenv Virtualenv
########## DO NOT INCLUDE THIS ##########
# File Location: /etc/supervisor/conf.d/celery-beat-appcom.conf
#########################################
[program:celery_beat_appcom]
process_name=%(program_name)s
command=/home/johndoe/django-app/celery-beat/run-appcom-celery-beat.sh
startsecs=10
autostart=true
autorestart=true
@nmfzone
nmfzone / letsencrypt.conf
Last active October 27, 2020 06:27
NginX Config for Django + Flower + Letsencrypt
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/letsencrypt; # make sure you create this directory
}