Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: barryclark/jekyll-now
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: devkini/devkini-old.github.io
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Join the chat at https://gitter.im/devkini/devkini.github.io](https://badges.gitter.im/devkini/devkini.github.io.svg)](https://gitter.im/devkini/devkini.github.io?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

# Jekyll Now

**Jekyll** is a static site generator that's perfect for GitHub hosted blogs ([Jekyll Repository](https://github.com/jekyll/jekyll))
@@ -115,4 +117,4 @@ Issues and Pull Requests are greatly appreciated. If you've never contributed to

You can start by [opening an issue](https://github.com/barryclark/jekyll-now/issues/new) describing the problem that you're looking to resolve and we'll go from there.

I want to keep Jekyll Now as minimal as possible. Every line of code should be one that's useful to 90% of the people using it. Please bear that in mind when submitting feature requests. If it's not something that most people will use, it probably won't get merged. :guardsman:
I want to keep Jekyll Now as minimal as possible. Every line of code should be one that's useful to 90% of the people using it. Please bear that in mind when submitting feature requests. If it's not something that most people will use, it probably won't get merged. :guardsman:
23 changes: 15 additions & 8 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -3,13 +3,13 @@
#

# Name of your site (displayed in the header)
name: Your Name
name: "#devkini"

# Short bio or description (displayed in the header)
description: Web Developer from Somewhere
description: Group of software developers in Malaysia

# URL of your avatar or profile pic (you could use your GitHub profile pic)
avatar: https://raw.githubusercontent.com/barryclark/jekyll-now/master/images/jekyll-logo.png
avatar: http://i.imgur.com/wxhzSUi.jpg

#
# Flags below are optional
@@ -21,20 +21,21 @@ footer-links:
email:
facebook:
flickr:
github: barryclark/jekyll-now
github: devkini
instagram:
linkedin:
pinterest:
rss: # just type anything here for a working RSS icon, make sure you set the "url" above!
twitter: jekyllrb
twitter: devkini
stackoverflow: # your stackoverflow profile, e.g. "users/50476/bart-kiers"
youtube: # channel/<your_long_string> or user/<user-name>
googleplus: # anything in your profile username that comes after plus.google.com/
telegram: devkini


# Enter your Disqus shortname (not your username) to enable commenting on posts
# You can find your shortname on the Settings page of your Disqus account
disqus:
disqus: devkini

# Enter your Google Analytics web tracking code (e.g. UA-2110908-2) to activate tracking
google_analytics:
@@ -53,9 +54,13 @@ baseurl: ""
# !! You don't need to change any of the configuration flags below !!
#

markdown: redcarpet
highlighter: pygments
markdown: kramdown
permalink: /:title/
markdown_ext: markdown,mkdown,mkdn,mkd,md

kramdown:
input: GFM
syntax_highlighter: rouge

# The release of Jekyll Now that you're using
version: v1.1.0
@@ -75,3 +80,5 @@ exclude:
- LICENSE
- README.md
- CNAME

excerpt_separator: "<!--more-->"
31 changes: 31 additions & 0 deletions _drafts/week-3-dec-2015-updates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
layout: post
title: Week 3 Dec 2015 Updates
---

Hello, this is the first series of updates on software development that we hope to do on weekly basis.

1. [Gitlab Pages](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/80) (akin to Github Pages) [is coming to gitlab.com in this 22/12 release](https://about.gitlab.com/direction/)
2. Google [Accelerated Mobile Pages (AMP)](https://github.com/ampproject/amphtml) project. This might be an [old news](https://googleblog.blogspot.my/2015/10/introducing-accelerated-mobile-pages.html) but we've just picking it up today. It is an attempt to make static web content load faster. This is particularly of interest to content publisher such as media company and being viewed as Google response to Facebook Instant Articles.
3. Django Project [received a massive grant](https://www.djangoproject.com/weblog/2015/dec/11/django-awarded-moss-grant/) from Mozilla Open Source Support (MOSS) program - $150K that it will be used to fund development of, among other things HTTP2, background tasks and websocket support.
4. [Angular 2](https://angular.io/) Beta [released](http://angularjs.blogspot.my/2015/12/angular-2-beta.html). Now maybe a good time to start looking into the framework if you're still on Angular 1.
5. This is more than a week old but we listed here for it's significance. A [new Android emulator from Android Studio 2.0 Preview](http://android-developers.blogspot.my/2015/12/android-studio-20-preview-android.html) ! We all know how slow the Android emulator is and this one claimed to fix that.
6. ReactOS, an OS project that try to build an open source Windows fully compatible OS from scratch finally [reach an RC (Release Candidate)](http://finance.yahoo.com/news/reactos-open-source-windows-clone-173145859.html) stage. If you're old enough to be on the Internet, you'll realized that this project was started 17 years ago !
7. [Rust 1.5 released](http://blog.rust-lang.org/2015/12/10/Rust-1.5.html). Rust is a system programming language aimed to offer better alternative than C/C++ for writing system program.
8. A number of updates on the AI (Artificial Intelligence) space:-
- [Facebook released AI hardware design](http://arstechnica.com/information-technology/2015/12/facebooks-open-sourcing-of-ai-hardware-is-the-start-of-the-deep-learning-revolution/).
- [Google released open source AI software](http://www.wired.com/2015/11/google-open-sources-its-artificial-intelligence-engine/).
- [Introducing OpenAI](https://openai.com/blog/introducing-openai/).
9. Let's Encrypt, a project to provide an easy to use free SSL certificate for everyone, [now opened to public in limited beta](http://blog.apnic.net/2015/12/16/now-everybody-can-https/)
10. AMD announced [GPUOpen - Open Source Tools, Graphics Effects, Libraries And SDKs](http://wccftech.com/amds-answer-to-nvidias-gameworks-gpuopen-announced-open-source-tools-graphics-effects-and-libraries/) for GPU based development.

## Products/Services

Here some interesting products or services we found this week:-

1. List of VPS providers in Japan - [https://romanrm.net/vps/japan].
2. An easy way to build website - http://kedaiweb.site/.
3. Another easy way to build website but this is a bit different, it build your website from your Facebook Page. Quite cool and practical idea I think - http://instaweb.my/.
4. Webfaction (disclosure: my favourite shared hosting) has added [support for PHP7](https://blog.webfaction.com/2015/12/php-7-is-here/) in it's hosting package.

That's all for now. Until we meet again next week. Meanwhile, why not hop to our [Telegram Group](https://telegram.me/joinchat/ACIF0AHECE3dGeOPeqM8zw) for discussion ?
6 changes: 6 additions & 0 deletions _includes/gitter-sidecar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
((window.gitter = {}).chat = {}).options = {
room: 'devkini/devkini.github.io'
};
</script>
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>
7 changes: 6 additions & 1 deletion _includes/meta.html
Original file line number Diff line number Diff line change
@@ -2,6 +2,11 @@
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0'>
<meta name="twitter:card" content="summary" />
<meta name="twitter:description" content="We are a group of software developers/programmers in Malaysia. Most of the time, we do discussion in a Telegram group (contact @k4ml for invite)." />
<meta name="twitter:title" content="DevKini" />
<meta name="twitter:site" content="@devkini" />
<meta name="twitter:image" content="http://i.imgur.com/wxhzSUi.jpg" />

{% if page.excerpt %}
<meta name="description" content="{{ page.excerpt| strip_html }}" />
@@ -15,4 +20,4 @@
{% if page.title %}
<meta property="og:title" content="{{ page.title }}" />
<meta property="twitter:title" content="{{ page.title }}" />
{% endif %}
{% endif %}
3 changes: 2 additions & 1 deletion _includes/svg-icons.html
Original file line number Diff line number Diff line change
@@ -10,4 +10,5 @@
{% if site.footer-links.twitter %}<a href="https://www.twitter.com/{{ site.footer-links.twitter }}"><i class="svg-icon twitter"></i></a>{% endif %}
{% if site.footer-links.stackoverflow %}<a href="http://stackoverflow.com/{{ site.footer-links.stackoverflow }}"><i class="svg-icon stackoverflow"></i></a>{% endif %}
{% if site.footer-links.youtube %}<a href="https://youtube.com/{{ site.footer-links.youtube }}"><i class="svg-icon youtube"></i></a>{% endif %}
{% if site.footer-links.googleplus %}<a href="https://plus.google.com/{{ site.footer-links.googleplus }}"><i class="svg-icon googleplus"></i></a>{% endif %}
{% if site.footer-links.googleplus %}<a href="https://plus.google.com/{{ site.footer-links.googleplus }}"><i class="svg-icon googleplus"></i></a>{% endif %}
{% if site.footer-links.telegram %}<a href="https://telegram.me/{{ site.footer-links.telegram }}"><i class="svg-icon telegram"></i></a>{% endif %}
5 changes: 3 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
<![endif]-->

<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/style.css" />
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/custom.css" />
<link rel="alternate" type="application/rss+xml" title="{{ site.name }} - {{ site.description }}" href="{{ site.baseurl }}/feed.xml" />

<!-- Created with Jekyll Now - http://github.com/barryclark/jekyll-now -->
@@ -27,8 +28,7 @@ <h1 class="site-name"><a href="{{ site.baseurl }}/">{{ site.name }}</a></h1>
</div>

<nav>
<a href="{{ site.baseurl }}/">Blog</a>
<a href="{{ site.baseurl }}/about">About</a>

</nav>
</header>
</div>
@@ -47,5 +47,6 @@ <h1 class="site-name"><a href="{{ site.baseurl }}/">{{ site.name }}</a></h1>
</div>

{% include analytics.html %}
{% include gitter-sidecar.html %}
</body>
</html>
224 changes: 224 additions & 0 deletions _posts/2015-12-06-getting-started-with-laravel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
---
layout: post
title: Getting Started With Laravel
author: kamal
---

I'm using the [`laravel-base`][1] as starting point. For starter, the [`laravel-base`][1]'s `Readme.md` already covering it well.

<!--more-->

## Database Tables
Since I want to store some data in the db, the first thing to do is to create the table's schema. You accomplish this using the `artisan` command:-

```
php artisan make:migration create_customers_table --create=customers
```

This will create the schema migration file in `database/migrations/2015_12_06_095232_create_customers_table.php`. The file look like:-

```php
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCustomersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('customers', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('name', 255);
$table->text('address');
$table->string('phone_no', 255);
});
}

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

The column `id` and `timestamps` were added by default but you have to add other column manually. Once you have filled up the file with all the column you want, you can run the `migrate` command to let laravel create the corresponding database table:-

```
php artisan migrate
```

## Model

To interact with the database, Laravel use an ORM named Eloquent. To create the model, we can ru the command:-

```
php artisan make:model Customer
```

This will create a file named `Customer.php` in the `app/` folder. I wish the `artisan` command show the exact path where the files being generated instead of just showing:-

```
Model created successfully.
```

## Controller

Controller will be the meat of the application as this is where user request being processed. To create the controller, we run the command:-

```
php artisan make:controller CustomerController
```

This will create a file `app/Http/Controllers/CustomerController.php`. The file will contain a class with some pre-defined methods:-

```php
<?php
class CustomerController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(){}
public function create(){}
public function store(){}
public function store(Request $request) {}
public function edit($id) {}
...
```

## Routing

Having a controller alone is not enough as Laravel still don't know about the controller and it relation with the incoming request. So we need to define a route that will match the url user request with the controller. Open `/app/Http/routes.php` and add the routing config:-

```php
<?php
Route::resource('customer', 'CustomerController');
```

With above route definition, if you try to access url such as http://localhost:8000/customer, Laravel will execute the `index()` method in `CustomerController` class. This is where I got stucked initially, as the existing routes defined in `laravel-base` look like this:-

```php
<?php

Route::get('/', function () {
return view('welcome');
});

Route::controller('auth', 'Auth\AuthController');
Route::controller('password', 'Auth\PasswordController');
```

Notice that they're using `Route::controller` instead. Turn out there are 2 types of controller in Laravel - RESTFull resource controller and Implicit controller. The one generated with the `artisan` command basically a resource controller so that's why you should attach it to the route with `Route::resource()` and not `Route::controller()`.

## Views

The controller should return an output (or HTTP speak, a response) to user. At the very basic, we can just return a plain string:-

```php
<?php
class CustomerController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return 'Hello world !';
}
```

But as the comment in above method mention, the method supposed to return a `Response` object. If we return a plain string, Laravel will wrap it into a `Response` object but we can also explicitly return a `Response` object:-

```php
<?php
class CustomerController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return new Response('Hello world !', 200);
}
```

The second argument to `Response()` which is a HTTP status code to return is optional but that's the advantage of returning a `Response` object, as it allow us to return custom status code instead of the default `200 OK`. However most of the time what we would return from controller is a `Views` instead:-

```php
<?php
class CustomerController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('customers/list');
}
```

Views basically a template that contain the actual response we want to return to user. As in above code, Laravel will look for file called `resources/views/customers/list.blade.php`. Blade is the default templating language used by Laravel. The file `list.blade.php` is just like the regular HTML file but with some special syntax:-

```html
@extends('app')

@section('content')
<div class="container">
<div class="content">
<div class="title">Customers</div>
</div>
</div>
@stop
```

## Helpers

Coming from Django, one thing that I'd immediately looked into is the ability to generate url from the defined routing. In Django it's called reverse url routing. In Laravel, this exists in the form of helpers function called `route()`. You can pass the routing name to the function and it will return the corresponding url. For example:-

```
route('customer.index') // will return /customer/
```

For resource controller, the name is automatically generated and you can refer the [documentation][2] on the available name. In the Views template, you can call the function like this:-

{% raw %}
```html
@extends('app')

@section('content')
<div class="container">
<div class="content">
<div class="title">Customers</div>
<form action="{{ route('customer.store') }}" method="post">
<input type="text" name="name" />
</form>
</div>
</div>
@stop
{% endraw %}
```

That's all for now. Hopefully I can show more in-depth example as I progress forward in learning Laravel.

[1]:https://github.com/zulfajuniadi/laravel-base
[2]:http://laravel.com/docs/5.1/controllers#restful-resource-controllers
Loading