Skip to content

Instantly share code, notes, and snippets.

View nasrulhazim's full-sized avatar
🎯
Focusing

Nasrul Hazim Bin Mohamad nasrulhazim

🎯
Focusing
View GitHub Profile
@nasrulhazim
nasrulhazim / quotes.json
Created May 14, 2017 08:23
Quotes List in JSON Format
{
"quotes": [
{
"quote":"Life isn’t about getting and having, it’s about giving and being.","author":"Kevin Kruse"},
{
"quote":"Whatever the mind of man can conceive and believe, it can achieve.","author":"Napoleon Hill"},
{
"quote":"Strive not to be a success, but rather to be of value.","author":"Albert Einstein"},
{
@nasrulhazim
nasrulhazim / resume.json
Last active March 6, 2024 16:59
Nasrul Hazim Resume
{
"meta": {
"theme": "elegant",
"version": "v1.0.0",
"canonical": "https://github.com/jsonresume/resume-schema/blob/v1.0.0/schema.json"
},
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Nasrul Hazim Mohamad",
"label": "Solution Architect, Software Engineer, IT Trainer & Consultant",
@nasrulhazim
nasrulhazim / ci.yml
Created November 20, 2020 15:32
GitHub Action - MySQL Service for Laravel with Multiple Databases
name: Unit Test
on:
push:
branches: [develop]
pull_request:
branches: [master, develop]
jobs:
PHPUnit:
@nasrulhazim
nasrulhazim / macosx-install-php-oracle-oci8.md
Last active February 7, 2024 10:25 — forked from gido/macosx-install-php-oracle-oci8.md
install Oracle PHP Extension (oracle OCI8) - instantclient for Mac OS 10.12.6 - homebrew environnement - on PHP 7.2

Installation

This procedure is tested on Mac OS X 10.12.6

PHP 7.2 installed with Homebrew.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):

@nasrulhazim
nasrulhazim / haproxy-cors.md
Last active January 22, 2024 06:12
Setting Up CORS in HAProxy
frontend localnodes
    bind *:80
    reqadd X-Forwarded-Proto:\ http

    # Add CORS headers when Origin header is present
    capture request header origin len 128
    http-response add-header Access-Control-Allow-Origin %[capture.req.hdr(0)] if { capture.req.hdr(0) -m found }
    rspadd Access-Control-Allow-Methods:\ GET,\ HEAD,\ OPTIONS,\ POST,\ PUT  if { capture.req.hdr(0) -m found }
    rspadd Access-Control-Allow-Credentials:\ true  if { capture.req.hdr(0) -m found }
@nasrulhazim
nasrulhazim / .htaccess
Last active November 15, 2023 03:43
Laravel .htaccess with Security & Optimisation
# Directory Listing
Options -Indexes
<IfModule mod_security.c>
# Server Information Disclosure
ServerTokens Prod
ServerSignature Off
SecServerSignature " "
</IfModule>
@nasrulhazim
nasrulhazim / install-php-mssql-drivers-in-macos-mojave.md
Last active November 8, 2023 17:18
Install PHP MSSQL Driver in MacOS (Mojave)

Installing Brew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Installing MSSQL Tools

brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
@nasrulhazim
nasrulhazim / dowload-files-from-ftp-server-using-python3.md
Last active November 1, 2023 14:48
Download Files From FTP Server using Python3
from ftplib import FTP
from datetime import datetime

start = datetime.now()
ftp = FTP('your-ftp-domain-or-ip')
ftp.login('your-username','your-password')

# Get All Files
files = ftp.nlst()
@nasrulhazim
nasrulhazim / 01.md
Last active October 23, 2023 07:19
Laravel Default API Login

Setup

Migration

Create new migration script:

php artisan make:migration add_api_token --table=users
@nasrulhazim
nasrulhazim / azure-pipelines.yml
Last active October 9, 2023 13:57 — forked from zanechua/azure-pipelines.yml
Azure Pipeline + Laravel + PHPUnit + Laravel Dusk
# PHP
# Test and package your PHP project.
# Add steps that run tests, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/php
trigger:
- develop
pool:
vmImage: 'Ubuntu-16.04'