Skip to content

Instantly share code, notes, and snippets.

View az-iar's full-sized avatar

Azri Ismail az-iar

View GitHub Profile
@az-iar
az-iar / install.sh
Created July 17, 2019 18:08
Install PPTP on ubuntu server
# install pptpd
apt-get update
apt-get install -y pptpd
# add username and password for user
vi /etc/ppp/chap-secrets
@az-iar
az-iar / install wkhtmltopdf in ubuntu
Last active July 12, 2019 07:09 — forked from lobermann/sh
Install wkhtmltopdf on headless ubuntu 18 vps
sudo wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo apt install fontconfig libxrender1 xfonts-75dpi xfonts-base
sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
@az-iar
az-iar / options.php
Last active February 2, 2018 03:01
Form select options helpers
<?php
if (!function_exists('titles')) {
function titles()
{
return [
'Encik' => 'Encik',
'Cik' => 'Cik',
'Tuan' => 'Tuan',
'Puan' => 'Puan',
@az-iar
az-iar / malaysian_states.json
Created February 5, 2017 14:37
List of all Malaysian states
[
{
"code": "JHR",
"name": "Johor"
},
{
"code": "KDH",
"name": "Kedah"
},
{
@az-iar
az-iar / helpers.php
Created October 4, 2016 04:52
Split string by max length
<?php
function split_string_by_length($string, $max_length)
{
$array = explode(' ', $string);
$length = 0;
foreach ($array as $word) {
$newLength = $length + strlen($word) + 1;
@az-iar
az-iar / fix-order-grid.php
Created June 28, 2016 02:54
magento - fix missing order and invoice grid data
<?php
include_once 'abstract.php';
class FixOrderGrid extends Mage_Shell_Abstract
{
/**
* Run script
*
*/
@az-iar
az-iar / .vimrc
Last active February 6, 2016 17:28
vim config
syntax enable
set number " Show line numbers
set showmatch " Highlight matching brace
set visualbell " Use visual bell (no beeping)
set hlsearch " Highlight all search results
set smartcase " Enable smart-case search
set ignorecase " Always case-insensitive
set incsearch " Searches for strings incrementally
@az-iar
az-iar / countries.php
Last active October 13, 2015 09:46
List of countries and states of Malaysia
<?php
class Country {
public static $countries = [
"Afghanistan" => "af",
"Albania" => "al",
"Algeria" => "dz",
"American Samoa" => "as",
"Andorra" => "ad",
"Angola" => "ad",
@az-iar
az-iar / assign_product_thumbnails.php
Created August 13, 2015 06:19
Magento - Shell Scripts
<?php
require_once 'abstract.php';
class Mage_Shell_Assign_Product_Thumbnails extends Mage_Shell_Abstract
{
/**
* Run script
*
@az-iar
az-iar / MagentoHasher.php
Created March 19, 2015 09:30
Magento user password hasher for laravel 5
<?php namespace App\Services;
use Illuminate\Contracts\Hashing\Hasher;
class MagentoHasher implements Hasher
{
const CHARS_LOWERS = 'abcdefghijklmnopqrstuvwxyz';
const CHARS_UPPERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
const CHARS_DIGITS = '0123456789';