To The Lecturers

Sorry for sleeping in your classes.

Yes, I have tried to force myself to stay awake, to stay concentrated on you. It is not your fault, maybe it is.

But it is mostly mine, I just can’t stand listening to you for 1 – 2 hours straight.

You see, I learn by actually solving problems. I learn by examples, I follow tutorials online when I have an actual problem to solve.

But I just can’t learn well when I am expected to pick something up without knowing what problems it can solve, or where the heck am I even going to apply the knowledge.

We are not talented, we are just driven to learn when we need to.

I wonder when will our education system be changed to truly benefit us. Do you want to be a part of the change?

5 Ways to Stay Updated For Tech Events In Kuala Lumpur

There are several online resources that you can use to get to know latest tech events in KL or Klang Valley.

Join Facebook Groups. There are plenty of tech user groups and discussion groups full of techpreneurs on Facebook for you to join and get involved. If you haven’t joined one before, you may refer to my list of Malaysia and Singapore Developer Interest Groups to get started.

Subscribe to thelist. A weekly e-mail that informs you of great tech events coming up in that week. They also have a Singapore counterpart here.

Meetup.com. If Facebook Groups are too hard to stay updated for you, you should try using meetup.com as some of the event organisers use it to promote their events. But watch out for groups that are setup to promote MLM businesses.

Calendata. It’s a bit like meetup.com but Calendata curates the events into a list for you, it can be synced with your Google Calendar too.

MaGIC. The newly setup government agency to promote tech entrepreneurship in Malaysia organises a lot of great events that you will undoubtedly benefit from.

Hope you enjoy the list. Let me know if I left out any!

Dead Simple Laravel on Heroku

I assume that you already know how to use Git and Heroku. If you don’t, go http://try.github.com to learn Git, and download Heroku toolbelt, of course you need to install Git in your computer.

Heroku is a rock solid PaaS platform for you to host web apps easily. With the new update from Heroku for supporting composer and of course, Laravel. PHP lovers now have one more damn good hosting option for their favorite framework Laravel.

Ho shit I love Laravel, it’s better than meth.

Now I just going to explain a few tweaks that you need to do to Laravel before it runs on Heroku.

Step 0: Create a Laravel Project

So as usual:

$ cd ~/apps
$ composer create-project laravel/laravel app_name

Wait! If you do not understand the lines above, you probably need to learn how to use PHP Composer. There is a chance you don’t even know you should do this thing in Terminal (OS X) or Git Bash (Windows).

What we just did is that we have moved into ~/apps folder and created a Laravel project, with any name of the app you like lah.

Then the next thing we need to do is initiate a git repository for the app, and create a heroku app then push it up!

$ git init
$ git add .
$ git commit -m 'Initialised Laravel'
$ heroku create
$ git push -u heroku master

But wait! Heroku recognized that it’s a PHP app but couldn’t proceed because… composer.lock is not checked in!

Step 1: Unignore composer.lock

Turns out, by default, Laravel’s default .gitignore has composer.lock to be ignored. Open up .gitignore and delete the line with composer.lock in it.

Then we recommit the .gitignore and try to push again. This time, we get this:

404

404

So what just happened?

Turns out that by default, Heroku thinks that your project root folder should have index.php to serve as homepage. But Laravel is different, the homepage is actually inside public/ folder.

So how do we make heroku serve public/index.php instead?

We need to add a Procfile. A Procfile (process file) declares the processes of the app, you got like web processes (deal with web requests) and background processes (queues or workers that send e-mails, do mundane tasks so web requests don’t get slowed down).

Step 2: Procfile

To make the Procfile, just create a new file named… Procfile and put it in project root. Inside Procfile, just write:

web: vendor/bin/heroku-php-apache2 public

Recommit, and push. It should work now.

Screen Shot 2014-05-19 at 8.49.30 PM