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 / wp-admin-bootstrap.css
Created July 24, 2016 14:44
Use Bootstrap in WordPress Plugin Setting Page
.bs-wrapper{/*!
* Bootstrap v3.3.4 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v3.0.2 | MIT License | git.io/normalize *//*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */}.bs-wrapper html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}.bs-wrapper body{margin:0}.bs-wrapper article,.bs-wrapper aside,.bs-wrapper details,.bs-wrapper figcaption,.bs-wrapper figure,.bs-wrapper footer,.bs-wrapper header,.bs-wrapper hgroup,.bs-wrapper main,.bs-wrapper menu,.bs-wrapper nav,.bs-wrapper section,.bs-wrapper summary{display:block}.bs-wrapper audio,.bs-wrapper canvas,.bs-wrapper progress,.bs-wrapper video{display:inline-block;vertical-align:baseline}.bs-wrapper audio:not([controls]){display:none;height:0}.bs-wrapper [hidden],.bs-wrapper template{display:none}.bs-wrapper a{background-color:transparent}.bs-wrapper a:active,.bs-wrapper a:hover
@nasrulhazim
nasrulhazim / AclDefaultSeeder.php
Created August 7, 2016 16:46
Laratrust Default Role, Permission and User
<?php
use Illuminate\Database\Seeder;
use App\User;
use App\Role;
use App\Permission;
class AclDefaultSeeder extends Seeder
{
/**
@nasrulhazim
nasrulhazim / master.blade.php
Created August 8, 2016 16:12
Laravel Master Layout using Bootstrap Framework
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>@yield('title')</title>
<!-- Bootstrap -->
@nasrulhazim
nasrulhazim / DatabaseEnvironment.php
Created August 16, 2016 10:10
A sample of custom Artisan command
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
class DatabaseEnvironment extends Command
{
/**
@nasrulhazim
nasrulhazim / VIewComposer.php
Last active August 21, 2016 16:17
Array Multidimensional Unique
<?php
namespace App\Http\ViewComposers;
use Illuminate\View\View;
use App\Repositories\UserRepository;
use Auth;
class MenuComposer
{
@nasrulhazim
nasrulhazim / practices.md
Last active August 22, 2016 20:01
Git Practices

Software Development with Git

Self Training 101

Each of the practices need to be repeated 5 times in order to master them. For example, if Practice 1 has a 4 steps to complete the practice, then Practice 1 need to be repeat 5 times with different project name.

Prefer project name with prefix self10x where x is an incremental number starting from 1.

Practice 1 - Initial

@nasrulhazim
nasrulhazim / Connection.php
Last active November 9, 2016 06:48
Simple PDO Wrapper
<?php
namespace App\Database;
use \PDO;
class Connection
{
private $conn;
private $database;
@nasrulhazim
nasrulhazim / Route.php
Created November 10, 2016 06:41
Simple Route - get route details and parameters
<?php
class Route
{
public static function getCurrentUri()
{
$basepath = implode('/',
array_slice(
explode('/', $_SERVER['SCRIPT_NAME']),
0, -1)
@nasrulhazim
nasrulhazim / console.php
Last active November 21, 2016 13:39
Artisan Extended
<?php
Artisan::command('clear:cache', function () {
$this->call('view:clear');
$this->call('config:cache');
$this->call('optimize');
});
Artisan::command('clear:serve', function () {
@nasrulhazim
nasrulhazim / software-development-learning-curve-guidelines.md
Created November 23, 2016 08:17
Software Development Learning Curve Guidelines

Software Development Learning Curve Guidelines

Target Platform

  1. Web Applications
  2. Mobile Applications
  3. Desktop Applications

Tools & Environments