Remove the 1px shadow from UINavigationBar

There is a shadow (only 1 pixel) below the UINavigationBar

With shadow

Read More

UIAlertView delegate in class method

To handle the UIAlertView (or any others class) delegate in class method just have to change the minus - to plus +

Read More

MySQL search order by relevance column using FULLTEXT

I’ve blamed by one of the client and says that the keyword that match the title shown at bottom. So want me to order by column match.

Finally I found the solution which is Full-Text Search.

Read More

Setup PHP environment in Mavericks using XAMPP

I’ve been using MAMP for some time, unfortunately, it seems like outdated (seldom update), now I’ve switched to XAMPP and it is up to date.

Read More

AFNetworking 2 - get JSON on error

I’ve just switched from AFNetworking 1.x to 2.x.

In AFNetworking 1.x, I make a request using JSONRequestOperationWithRequest method. i.e.

Read More

RSA encryption & decryption on PHP

I’ve come across RSA encryption on a very long string.

The solution is divide the long string into chunks according to the length of the key.

Read More

PHP Laravel 4 - before & after action

We may need to perform some actions before the controller function get called.

For example

Check user authentication before access to certain page.

AccountController.php

Read More

Apache Virtual Host accessed by other machines in LAN

Environment

This is tested on Ubuntu 13.04 that running on VMWare Fusion 5. Host machine is MacBookPro that running Mavericks.

Read More

PHP - Restructure multi-dimentional array into single dimention

Source

For example, we have array like this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
array(
'test_1' => array(
'msg_1' => 'this is the first desc',
'msg_2' => 'this is the second desc',
),
'test_2' => 'this is the third desc',
'test_3' => array(
'msg_1' => array(
'foo_1' => 'this is the fourth desc',
),
'msg_2' => 'this is the fifth desc',
),
'this is the sixth desc',
);

Read More

Problem with AFImageRequestOperation block not executed

Recently I’ve faced a weird bug about displaying image from URL to UIImageView. Finally I found out is the header issue.

Read More