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
@alienxp03
alienxp03 / malaysia_holidays.json
Created January 6, 2017 06:41
Malaysia 2017 Holidays (including states)
[
{
"name": "New Years Day",
"date": "01/01/2017",
"states": [
"Kuala Lumpur",
"Labuan",
"Malacca",
"Negeri Sembilan",
"Pahang",

Most active GitHub users in Malaysia

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Mon, 14 Apr 2014 04:55:12 GMT till Tue, 14 Apr 2015 04:55:12 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter((user) -> user.location = 'malaysia')
@akutaktau
akutaktau / index.php
Last active March 29, 2017 06:17
Trigger which version Whatsapp to sent messages
<?php
/**
Thanks stackoverflow
*/
function getOS($user_agent) {
$os_array = array(
'/windows nt 10/i' => 'Windows 10',
'/windows nt 6.3/i' => 'Windows 8.1',
'/windows nt 6.2/i' => 'Windows 8',
'/windows nt 6.1/i' => 'Windows 7',
@jeffochoa
jeffochoa / RouterServiceProvider.php
Created July 30, 2017 20:28
Get collection of available routes in Laravel
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Route;
use Illuminate\Routing\Route as Router;
class RouterServiceProvider extends ServiceProvider
{
image: ubuntu:zesty
services:
- mariadb
variables:
MYSQL_DATABASE: smsclub_old
MYSQL_ROOT_PASSWORD: root
before_script:
@nafiesl
nafiesl / codeship-setup-commands-laravel-mysql.txt
Last active February 23, 2021 13:07
Codeship Setup Commands for Laravel that uses MySQL Database
phpenv local 7.0
echo "memory_limit = 512M" >> /home/rof/.phpenv/versions/$(phpenv version-name)/etc/php.ini
# install dependencies
COMPOSER_HOME=${HOME}/cache/composer
composer install --prefer-dist --no-interaction
# set up environment variables
touch .env
echo "APP_ENV=testing" >> .env
echo "APP_DEBUG=true" >> .env
echo "APP_KEY=base64:sQPFP80eWJQGo0SDPc+M2Tib+GLUocRYRw4RLsfM27I=" >> .env
@jeffochoa
jeffochoa / EloquentSortableServiceProvider.php
Last active June 9, 2021 01:33
Laravel Eloquent pagination and column sorting using macros
<?php
namespace App\Providers;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\ServiceProvider;
class EloquentSortableServiceProvider extends ServiceProvider
{
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/
ServerName example.com
<Directory /var/www/html/ebiddi-api/public>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
@adbrsln
adbrsln / mulitple-mysqlrouter.md
Last active April 5, 2022 05:18
Multiple MySQL Router Client (Different Cluster) on Single Server

Introductions

Planning to connect to multiple Cluster at once from a single server? heres the plan...

  • Cluster 1
    • c1-node-1
    • c1-node-2
    • c1-node-3
  • Cluster 2
    • c2-node-1
    • c2-node-2
@shah253kt
shah253kt / json
Created November 28, 2016 20:52
JSON file containing Swift Code of all banks in Malaysia (Last Update: 29th November 2016)
[
{
"ID": "1",
"Bank or Institution": "AFFIN BANK BERHAD",
"City": "KUALA LUMPUR",
"Branch": "",
"Swift Code": "PHBMMYKL"
},
{
"ID": "2",