Tuesday, June 13, 2017

Generating one image from multiple image using Imagick.

When I completed this feature in Laravel PHP frameworks last night, I got so hyped up, feeling so achieved. Then I thought, maybe I should share my excitement with someone. But then I realize, not many people understand this kind of excitedment, in the end, it is just a syok sendiri things.

So this Imagick can put many images into one image dynamically. You can set the image size (width x height), then decide which image to be the first in the code, the margin from the left and top. Once you tried one or two, you will feel it is very easy. If you need save, let say 5 images in first row and 2 images in second row, some condition checking need to be done for the minimum width of the whole image being generated. 

So first step
- check which row has more images
- use that max images count times the width of each image
- then the total had to be add with the gap size of each image. 
- After that, calculate number of rows (in this case it's 2)
- Then use the number of rows times the height of each image and add the gap of each image again.
- After setting the height and width of the main container, create new imagick object with the image that wanted to be input into the main container
- Attach it into the main container with the margin.
- Continue attach more images and in the end, just export it as a file name.

I will share some code and example in my next post. :-) 

Thursday, June 8, 2017

Few days trip to Kota Kinabalu

So I went to KK with my brothers. We wanted to go to Kundasang and island hopping.

Sorry, I got no picture in this post.

Luckily we are driving there, so going anywhere is also quite easy. But even if without car, you can pretty much travel anywhere in KK nowadays. Lots of people doing Grab and Uber, especially when there are a lot of discount or promocodes from Uber and Grab.

So we stay at nearby Jesselton Point, which is the place you get the package for island hopping (snorkeling, parasailing, zipline, jet ski, banana boat, flying fish, diving and so on). Don't straight pay for the amount displayed. Ask for discount because they usually will give discount.

Our accommodation is called The Bunk. It's cheap and located at good location. Many tourist and foreigner stays there because it is a cheap and strategic location. However, 2 nights of our stay, I got bitten by quite many bed bug. So we requested to checkout and get our refund back. So we moved to another cheap hotel nearby called Little Gaya Hotel. It's cheaper than many other hotel but it's clean and spacious, at least enough for us. Of course it is a lot more expensive than The Bunk, but I really rather pay extra than suffer.

The Bunk: RM 22 per bunk
Little Gaya Hotel: RM160 for 2 single beds, we add extra beds cost RM65. Total RM225 / 3, it will be RM75 each. 

For our island hopping, here's the price breakdown

Boat to go and back for 2 islands hopping : RM 35 
Parasailing: RM 70 each
Snorkeling equipment: RM 10 each 
Diving: RM 180 each 
Zipline: RM 68 each

Each of us take different combo.
Elder bro: Parasailing + Snorkeling. Total only RM 35+70+10 = 125
Me: Parasailing + Snorkeling + Zipline. Total only RM 35+70+10+68 = 193
Younger bro: Parasailing + Diving: Total only RM 35+70+180 = RM 285

There are 2 big shopping malls here called Suria Mall and Imago. If you have anything that you want to know more about this trip, just leave me a comment.

Tuesday, May 30, 2017

A little update about myself.

Pass few months, had been the most hectic month in my life. Receiving a lot of freelance request and only pick up few projects that I think worth my time. Now I am still engaged with the freelance project but manage to free up a bit of time to update my blog.

While writing this post, I stumbled upon a song sing by Sandy Lam in The Singer 2017 called 我最亲爱的. 


Many people feel this song is for lovers but when I heard this song, I think of my mom. Really wonder how is she doing in heaven and what will happen if she is still alive.


More people around me is getting married soon. Among my colleagues, I am the only one left that is not married. Even so, I don't feel the rush of it. Life should be taken seriously and I don't want to repeat the same thing happened last year. Haha.

Going for vacation is my next big thing. Then after that should be getting my house ready and enjoy my life more.