Nasrul Hazim Bin Mohamad

Training: Web Application Development with Lumen(API)

Jan
30

Date: Saturday, 6th February 2016

Available Seats: 25

Fee: Student – RM 100, Public – RM 250

Location: Level 2, above Yamaha Motorsport Shop Lot

REGISTER HERE

Objectives

To learn how to develop an API with micro-framework Lumen

Preparation

Following items need to be install first before coming to the class:

  • Laragon
  • Git & GitHub Account
  • Sublime Text 3
  • Postman (www.getpostman.com)

Prerequisites

PHP & MySQL is compulsory. A good understanding of OOP is value added.

Audience

Software developers with PHP and MySQL background.

Syllabus

  • Installation
  • Routing
  • Controllers
  • Responses
  • Database
  • Migrations
  • Eloquent Queries
  • API Integration

 

 

Bootstrap Studio: 2.0.0 Review

Jan
26
Bootstrap Studio 2.0.0

Bootstrap Studio 2.0.0

 

Bootstrap Studio 2.0.0 has been released. New features have been added – as per screen shot below.

So, I’ve tested some of the new features – multiple CSS, pages and JavaScript. I’m trying to use Animate.css & WOW.js.

Here my review:

  1. PAGES – The pages are working great! with Duplicate features, that’s awesome! Except one thing – if one of your menu(for example) change, you need to update all the pages – workaround make sure you use custom components so that you can pull / push any changes to the component.
  2. STYLES – as what it mentioned – yes you can have multiple CSS! But I’m looking for to be able to import external CSS perfectly(currently I just copy-paste the animate.css, but it’s not working – have to export & update my animate.css)
  3. JavaScript – Again, importing JavaScript will be good(currently I’m copy-paste the WOW.js into new JavaScript) and the scripts is in alphabetical order! I hope I can manage my JavaScript position.

Below are some screenshots of the new Bootstrap Studio 2.0.0 and here the demo (with a little tweak to ensure animate.css & WOW.js are working) 🙂

Bootstrap Studio 2.0.0: Design Features

Bootstrap Studio 2.0.0: Design Features

Bootstrap Studio 2.0.0: Pages

Bootstrap Studio 2.0.0: Pages

Git: Common Tagging Commands

Jan
21

Below are the common tagging commands that usually use based scenario event – accidentally name wrong tag, need to retagging or probably want some commit available at particular tag..retagging required.

# display all tags available
git tag

# add local tag
git tag youTagName

# remove local tag
git tag -d yourTagName

# push all local tags to remote
git push origin --tags

# push specific tag to remote
git push origin :refs/tags/yourTagName

Training: Bootstrap Studio – Batch 2

Jan
20

Training: Mobile Apps Development with Intel XDK

Jan
18

Location: Medina Arabic Training & Solutions, Bangi Sentral (Above Melaka Kitchen Restauurant)


 

Date: 23th & 24th January 2016

Available Seats: 20 seats

Fees:

Student
Package Intel XDK API
2 Days 150
1 Day 50 120

 

Public
Package Intel XDK API
2 Days 250
1 Day 100 175

* Fee payment must be made first in order to reserved your seats.

Training-Intel-XDK-NHM-20160121

 

 

Register here if you unable to see the Google Form embed in this post.

Online Banking: Debit Card and Oversea Transaction Activation

Jan
12
Maybank

Maybank

Year 2016, some rules has been set for all debit card users in Malaysia. We’re required to enable the Debit Card Online and Oversea Transactions in order to purchase online.

I’ve done this for Maybank and it works. You need to enable Debit Card Online one time, and Oversea Transactions need to renew annually – correct me if i’m wrong.

So, for Maybank Debit Card User, just call 1-300-88-66-88 and ask to open Debit Card Online, together with Oversea Transaction. You will be ask few questions for verification purpose. Below are the questions asked:

  1. You Name (as on your IC)
  2. IC Number
  3. Debit Card Number
  4. Maybank Account Number

Then you just need less than 5 minutes for Maybank to activate both Debit Card Online & Oversea Transaction.

Don’t forget to change your daily Debit Card limit.

Now I’m  ready with licenses for my students(Bootstrap Studio)!

p/s: I think other bank should have similar steps as well.

Laravel: Using Laragon

Jan
09

Laragon is a windows program that helps new developers setup Laravel in a minute. Instant setup, extremely fast, extremely lightweight Laravel installation and manager for Windows users.

Laragon similar to WampServer or XAMPP.

Following are the steps taken to install Laragon after download it from Laragon website:

1

First run installation, this is the view

2

Choose your installation path, mine is locate at D partition

3

I love this one, I left this by it’s default value.

4

Just a summary, if it’s ok, click on Install button

5

Just wait a few minutes..should be quick installation

6

Yeah! DONE! You may want to restart your machine.

7

Now open up your Laragon

8

This is the default view – Start All (start all services – Apache, MySQL and PHP), Web (open up localhost), Database (open up PHPMyAdmin), Terminal (open up Commander), and Root(open up Document Root directory)

9

Click on Start All to start all the services – you should have something similar like this

10

Click on Terminal , will open up Cmdr

12

Click on Web button in Laragon interface will open up the localhost and display the PHP Info

13

Click on Database button will open up PHPMyAdmin – I prefer to use SQLYog for Database Administration

14

Create new Laravel project is easy – click on Menu > Laravel > Create Project > [ Lumen | Laravel 5 | Laravel 4 ]

15

Laragon also come with latest version PHP7 – Click on Menu > PHP > Version > PHP 7.0.0

16

PHP 7.0.0 enabled

17

Using the panel menus in Laragon interface, I’ve choose to create project named po.shup. Laragon will popup a command prompt running composer create-project laravel/laravel [project-name] –prefer-dist

24

After done create project

22

Test you project at [projet-name].dev. Now you’re ready from Laravel based project!

Training: Bootstrap Studio

Jan
03

Location: TBC

Date: 16th January 2016

Available Seats: 30 seats

Brochure

Training-Bootstrap-Studio-NHM-1.1-20160102

 

Registration closed!

InsyaAllah next month will be another Bootstrap Studio class! Stay tuned!

Lumen: API Development – Episode II

Jan
02

In this episode, we will configure the environment of the API, and setup some fake data. For those not yet read the Episode I, you can read it here.

In general, we have these steps:

  1. Configure .env
  2. Create model
  3. Create migration script & do migration
  4. Create seed script & do DB Seeding

For the first few steps will straightforward before we continue with Eloquent.

  1. Rename .env.example to .env
  2. Generate 32 random characters and update the APP_KEY – I use textmechanic to generate random characters
  3. Next, open up bootstrap/app.php and uncomment the following lines:
    • Line 6 – to enable to load .env file
    • Line 25 – to enable Eloquent

Now we’re done with minimum requirement configuration for our API. Next, we going to setup our fake data.

Before proceed to the next section, if you noticed that I did not change much in .env. This is due we’re using homestead – everything is ready for our development, including the database. So, no need to further change the configuration file .env, unless we’re moving to production, you may want to configure for production.

For our fake data, I have a table called departments. The departments table have the id, name and ordering.

In this section, we will learn about Model, Migration and Seeds.

First, create a model for departments and save it in app directory.

<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Department extends Model
{
	// for security concern, only allow these fields for mass assignments
	// Read more at https://laravel.com/docs/5.0/eloquent#mass-assignment
	protected $fillable = ['id','name','ordering'];

	// limit attributes displayed in model's array or JSON
	// https://laravel.com/docs/5.0/eloquent#converting-to-arrays-or-json
	protected $hidden = ['created_at','updated_at'];
}

Next, we need to create Migration scripts for departments table. Run the following in Git Bash.

php artisan make:migration create_departments_table --create=departments

And open up the database/migrations/[date-time]_create_departments_table.php and update the up method as following. This will preparing our departments table schema.

<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateDepartmentsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('departments', function (Blueprint $table) { $table->increments('id');
            $table->string('name');
            $table->integer('ordering');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('departments');
    }
}

Now connect to homestead via vagrant ssh and then run the migration script

php artisan migrate

Next, we need to add some fake data using the faker. Open up database/factories/ModelFactory.php and paste in the following codes in it:

<?php $factory->define(App\Department::class, function ($faker) {
    return [
        'name' => $faker->name,
        'ordering' => mt_rand(1,50)
    ];
});

[Update 20/1/2016]
Next, to insert our data, open up database/seeds/DatabaseSeeders.php and add the following lines in method run.

<?php

use Illuminate\Database\Seeder;

// include the model
use App\Department;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
    	DB::statement('SET FOREIGN_KEY_CHECKS = 0');

    	// empty table first
    	Department::truncate();

    	// create 50 records
    	factory(Department::class, 50)->create();

        // $this->call('UserTableSeeder');
    }
}

Now enter the vagrant ssh and go to document root of the API, then run php artisan db:seed. You may verify your data by login to MySQL.

So, that’s done for preparing our data, using some fake data. Next episode will be talking about Route & Controller. Stay tuned for next episode!