Nasrul Hazim Bin Mohamad

Software Development with Git

Aug
23

Number of practices that i’ve been doing from time to time. All theses are the basic user cases based on doing personal project.

I will add more about working in team with Git.

It’s a bit confusing at the beginning. You just need practices to master the flow of software development with Git.

Git: How to Sync Fork Repo With Master Repo

Jun
02

In this post, I will give you a step-by-step on How to synchronize your forked repository with the master repository.

First thing first, go to your forked repository and make sure to you in master branch

git checkout master

Setting Up the Master Remote Repository

git remote add upstream [URL]

Fetch Remote Repository Master

git fetch upstream

Now, you have downloaded the master repository, but not yet merge with your fork repository.

To merge your fork repository with master repository, run the following command:

git merge upstream/master

Now you have merge your local fork repository with master repository.

Next, you just have to push your fork repository to your fork remote repository.

git push fork master

Now you are done synchronize your fork repository with master repository! Congratulations!

 

Git: Undo

May
13

Here are some undo commands, depending on situation.

# To go back to staging from commit
git reset --soft HEAD~

# Unstaging
git reset HEAD <file>

# Undo Changes Made to the File
git checkout -- <file>

Git: How to Sync Fork with Master

May
13

You have forked numbers of repositories, but have no idea how to merge with the master copy if there’s changes. So here the solution.

# Add Upstream Remote
git remote add upstream [URL]

# Fetch Upstream
git fetch upstream

# Checkout master (your fork repo & in case you're not in master branch yet)
git checkout master

# Merge
git merge upstream/master

# Push to Fork
git push origin master

Training: Git 101

Mar
14

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.

Registration Form: http://goo.gl/forms/7ke6iZH2Zd

Date: 19th March 2016

Time: 9:00 AM – 4:00 PM

Location: http://bit.ly/cc-training-location

Fees: RM 20

Course Outline:

Introduction to Version Control System (VCS)

GIt Installation
– Config

GIt Basics
– Initialization
– Cloning
– Check File Status
– Commit
– Add
– Ignore files
– Undo Changes
– Unmodify Modified FIles
– Remote
– Tagging

GitHub

 

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

 

 

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

Lumen: API Development – Episode I

Dec
30

So, this post is about develop your own API using Lumen, a micro framework, a child of the Laravel (I assumed it that way). This topic will take few parts and this is the Episode 1 of Lumen: API Development.

Following tools required to be install on your machine:

  1. Virtual Box – For those using Avira Anti Virus, you might need to head over this article if you having problem with Virtual Box.
  2. Vagrant – Enable developers to easily share the same environment configurations
  3. Composer – Enable developers to manage packages for system dependencies
  4. Git – Famous version control (please do create a GitHub account)
  5. Sublime Text 3 – best text editor I’ve used so far. 🙂

Here are the basic steps taken for setting up the Lumen(all commands running in Git Bash):

  1. Create Lumen project at directory lumen-api
    composer create-project laravel/lumen lumen-api
  2. Install homestead
    cd lumen-api
    composer require laravel/homestead
  3. Make homestead
    php vendor/bin/homestead make

    OR

    php vendor/laravel/homestead/homestead make
  4. Create id_rsa at /C/Users/[yourname]/.ssh
    ssh-keygen -t rsa -C yourname@homestead

    Location of the id_rsa

    Location of the id_rsa

  5. Open Homestead.yaml and change map folder to working directory (step #1)
    map: "D:/WWW/lumen-api"

    homestead.yaml Configuration

    homestead.yaml Configuration

  6. Update C:/Windows/System32/drivers/etc/hosts file
     192.168.10.10 lumen-api.com
  7. install vagrant laravel/homestead (size about 1GB..taking about 45 minutes on 4mbps connection.. T_T)
     vagrant box add laravel/homestead

    Vagrant Add Box Laravel/Homestead

    Vagrant Add Box Laravel/Homestead

  8. Open up Virtual Box & start up the vagrant
     vagrant up
  9. Try to SSH to homestead to check if it’s ok
     ssh vagrant@192.168.10.10 -p 22

    Try to SSH to Homestead

    Try to SSH to Homestead

  10. Browse to lumen-api.com to check if the homestead installed properly

    Test lumen-api.com

    Test lumen-api.com

Y2016

Dec
18

Year 2016, InsyaAllah, next year to be a year of sharing knowledge of what I’ve learnt so far. Following are the trainings I would like to conduct:

1. Mobile Apps Development with jQuery Mobile
2. Mobile Apps Development with Intel XDK (incoming)
3. API Development with Slim Framework (incoming)
4. PHP Basic / Advanced
5. Web Development with CakePHP 3 (incoming)
6. Web Development with Laravel 5 (incoming)
7. Web Development with Yii Framework 2 (incoming)
8. WordPress for Developers – Beginner Level
9. WordPress Theme Development
10. WordPress Plugin Development

Those status incoming, it’s the one I’m preparing the syllabus & materials, summarizing the process, and so on. Hope more things can be share other than mentioned above such as the tools I’ve used along the process of the development – Sublime Text 3, SQLYog, Putty, Git and so on

Git: Rename Tag

Sep
03

Git, rename your tag.

git tag new old
git tag -d old
git push origin :refs/tags/old
git push --tags

Reference: How do you rename a Git tag?