Sending email from Amazon EC2 using postfix and Amazon SES Jul 26, 2013 Sending email is a basic functionality that most of the applications need to support. In my company latest project, we have to send invitation emails to users through an Amazon EC2 instance. It is relatively easy task because I can use built in email library from Code Igniter and point it to Amazon SES. It works perfectly until my colleague realize that there is a slightly delay when the application sends the email. ...
Migrate to Octopress Jul 25, 2013 Today, I decided to upload my new blog using Octopress into live. I have spent the last two weeks migrating my blog posts into Octopress. The process was not as smooth as I thought. I had to check every single blog post and re-apply all the code snippet tags, fix typo and add missing post. After all, I am quite happy with the end result. I can easily add new blog post through terminal and edit the post using my current favourite text editor Vim. ...
Playing with Google Map API May 27, 2013 The main purpose of this post is only to write about Google Map API for future reference. Here are the code snippets : Get the latitude and longitude based on address : http://maps.googleapis.com/maps/api/geocode/json?address=435A%20Kent%20St&sensor=true The code below set up the Google Map, put the marker and also make it grayscale 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 function initialize() { var map; var location = new google. ...
Override module config in Zend Framework 2 May 16, 2013 There is a time when you want to override module config in your Zend Framework 2 application. In my case, I have different configuration for SMS gateway in staging and live server. You can do this by overwriting the module.config.php file inside the module config’s folder. However, there are heaps of configuration inside module.config.php file. This approach will lead to maintenance nightmare when you need to change one or more configuration inside the file. ...
'Zend Framework 2 : The proper way to set application path in Javascript Object' May 06, 2013 Storing application path inside Javascript object is a way to avoid “hard coded” URL inside your Javascript file. It is pretty common to have like this in your Javascript file : 1 2 3 4 5 $.ajax({ type: POST, url: 'http://localhost/my-website/register', data: dataJSON }) That approach is completely fine. However, when you need to deploy your application, you need to manually change all the URL to match with your server. ...
My review after two months using VIM Mar 30, 2013 On January ( Two months ago ) , I decided to learn Vim after watching screencast from Destroy All Software. In one of the screencast, the guy shows how fast you can program when using Vim and use plugin to make it even better. I have known Vim for 4 years now but never actually keen to learn all the shortcuts. I remember I been to one of the PHP meetup in my city and one guy was presenting some of his code using Vim. ...
'Zend Framework 2 : get server URL in controller without using serverUrl()' Feb 15, 2013 Sometimes you need to be able to get current server URL inside controller in your Zend Framework 2 application. As you might know, you won’t be able to use $this->serverUrl() method in the controller as it’s a part of helper. So, here is the code that I am using to get server URL in controller : 1 $server_url = $this->getRequest()->getUri()->getScheme() . '://' . $this->getRequest()->getUri()->getHost(); Probably it’s not the best solution but it works for now. ...
Bootstrap Typeahead CakePHP 2.0 Feb 02, 2013 Demo : http://cbunny2.rudylee.com/users/typeahead Source : https://github.com/rudylee/cbunny In this post, I’ll explain how to integrate Twitter Bootstrap Typeahead with your CakePHP 2.0 application. We will avoid using helpers or plugins and stick with plain Javascript + jQuery. Make sure you have include jQuery, Bootstrap CSS and Bootstrap Javascript files in your CakePHP application. You can simply do it inside your default.ctp file ( the files are bootstrap.min.js and bootstrap.min.css ). After that we will create controller, action and view to put our input box. ...
Select2 AJAX Auto Complete with CakePHP 2.0 Feb 02, 2013 Demo : http://cbunny2.rudylee.com/users/select2 Source : https://github.com/rudylee/cbunny In this post, I’ll explain how to use Select2 inside CakePHP. We will avoid using any helpers and rely on jQuery + Javascript. Before we start, I presume you have downloaded Select2 and included the Javascript and CSS files inside your layout. Thus, I won’t explain how to import Select2 library into your CakePHP app ( you can download my cbunny app from Github if you are lost ). ...
Science of Productivity Jan 15, 2013 Continuing from my previous post about productivity, I just found a video that you guys might wanna check out. It covers some of the techniques from my previous post such as make your todo list doable and set up the morning dash. {% youtube lHfjvYzr-3g %}