Huy Dinh - Coding magic for food Blog

Magic coding [ ninja | monkey ] seeks secret code of legends (and 3 meals a day)!
August 31, 2008

Replacement zoomer for Magento

Author: Huy Dinh - Categories: PHP, Random - Tags: ,

One of Magento's little annoyances is the main image preview method - like everything else about Magento, it comes with bells and whistles. Is that a bad thing? Well, yes.

Before I complain, look at the original zoomer.

I'd argue whether the average user needs to zoom into an image using the a slider, because imo, they wither want to see the whole image or as much detail as possible (maximum zoom). Luckily the front end is much easier to change than the back end, so I've made my own zoomer tool which is infinitely easier to use (because you can't actually control anything) you just roll the mouse pointer over the image, a little box will appear that shows a portion of the actual image with maximum zoom. Move the mouse pointer and the zoomed image will be updated accordingly.

Easy, peasy, nifty.

See a demo and download it.

It was written specificly for Magento 1.1 so uses Prototype 1.4 instead of the latest.

To use it, follow similar instructions to installing lightbox:

Put the .js in the main js folder: /js/huy/.
Put the .css in your theme's css folder: /skin/frontend/default/default/css/huy/

In /app/design/frontend/default/default/template/catalog/product/view/ delete the following lines:

PHP:
  1. <p class="a-center" id="track_hint"><?php echo $this->__('Double click on above image to view full picture') ?></p>
  2. <div class="image-zoom" id="track_outer">
  3.     <img id="zoom_out" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_out.gif') ?>" alt="<?php echo $this->__('Zoom Out') ?>" class="btn-zoom-out" />
  4.     <div id="track">
  5.         <div id="handle"></div>
  6.     </div>
  7.     <img id="zoom_in" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_in.gif') ?>" alt="<?php echo $this->__('Zoom In') ?>" class="btn-zoom-in" />
  8. </div>
  9. <script type="text/javascript">
  10.     Event.observe(window, 'load', function() {
  11.         product_zoom = new Product.Zoom('image', 'track', 'handle', 'zoom_in', 'zoom_out');
  12.     });
  13. </script>

You may want to change the styling of zoomer.css to taste.

Remember to minify it!

August 30, 2008

Magento + Mosso = Fail

Author: Huy Dinh - Categories: AS2, Random - Tags: ,

Magento, the all singing, all dancing ecommerce system that's heads and shoulders above everything else. It has more features than a Swiss army knife, and best of all, it's open source and completely free to use!

Mosso is Rackspace's cloud computing service, it promises to be somewhere between a VPS (Virtual Private Server) and a dedicated server - it's scalable, dependable, and above all, fully managed and supported like Rackspace's excellent support.

You'd be forgiven for thinking that the 2 Ms would be a as sweet as chocolate, but you'd be wrong like I was wrong.

Having tested Magento on WebFusion's VPS, it was unacceptably slow, during peak times it would take 15 seconds to load the page on a fast broadband connection. The problem (probably) is that Magento uses a lot of CPU resources. It does a lot of database queries and reads and writes many files on each request. The caching system helps substantially but on a shared server, it's still too slow for practical use. Imagine if just a handful of people installed a copy of Magento on their VPS - the server would come to a halt pretty quickly.

In theory, using cloud computing with it's unlimited resources should speed Magento up exponentially, in reality however, the reverse is true. During peak time, most requests timed out, and the ones that do make it through takes more time than making tea.

Was the problem to do with Mosso? or can it be said of all cloud computing in general? I wont be answering that any time soon, I'm sticking to the ground for as long as I can.

So the only real solution for Magento is a dedicated server, which considering, is not too expensive if you are prepared to get your hands dirty. For the same price as a Mosso installation, you can get a basic dedicated server at EasySpace, and believe you me, Magento is very usable!

So click my EasySpace banner yo!

February 27, 2008

Interactive 3D Income Tax Calculator

Author: Huy Dinh - Categories: Random

Had a bit of free time lately, learned a bit of AS3 and Papervision3D, so naturally I put my education into the pursuit of something completely useless!

Check this out! (Before you nag, 08/09 values are estimates only... although it's pretty accurate if you earn less than £36,000 a year).

February 18, 2008

A cold day in London

Author: Huy Dinh - Categories: Random

The weather's been pretty miserable in London lately. Even when there is sunshine it's freezing! Look at the weather report:

London at it’s coldest

February 6, 2008

Slots Logic - a slot machine search engine

Author: Huy Dinh - Categories: PHP, Random

Previously known as Slots Boffin, Slots Logic is a website with information and reviews about slot machines. I don't know when it was launched but is live now, and it's pretty good.

The site is nice and colourful with good icons and graphics. My part in the site was the PHP engine that searches for specific slot machines.

So, if you want to know more about slot machines, go to http://www.slotslogic.com!

The Lynx Effect

Author: Huy Dinh - Categories: Random

Wooooh! The LynxEffect.com site is finally live after 5 months of beta test (5 months of mind changes and pain).

Actually, the site went live in early January with localised versions rolled out about 2 weeks ago.

In that time I have moved from Preloaded, so the site is no longer my pain, but I feel sorry for my ex-colleagues who are still working on it, especially Jason, who must have lost a lot of sleep over it.

Dan (the guy who built all the flash templates) got the right idea by working as a freelancer, left the project very early on. Even though he was only exposed to a short amount of time, he has had his fair share of misery.

Dan thinks that the site has a bad omen - his laptop was stolen during development, and in a separate incident, the office was broken into many laptops were stolen.

Check it out: http://www.lynxeffect.com, but be warned, the bad luck may be passed on to you too!

Spooky!

December 19, 2007

Preloaded, design agency of the year

Author: Huy Dinh - Categories: Random

Wow, Preloaded has won .net's design agency of the year award!

Tracking crazy

Author: Huy Dinh - Categories: Flash, Random - Tags: , ,

On Axe (The Lynx Effect) yet again, this time to implement another tracking service into the flash app.

Back in March 07, it was decided that only Google Analytics would be used to track user's journey through the site. Came July, after the site had been finished, the specifications changed, the client wanted to use Webtrends. Then, somewhere along the line Spotlight and DoubleClick was added... so, that's 4 tracking service to track one site that doesn't even display adverts... or... is that the next step?

Oh, I forgot to mention that Traction is also used to track interactions and data submission, making a total of 5 tracking services.

Is that an overkill or what?

Then again, the number of companies involved in the website is 6 (or so), and I suppose each want their own tracking system implemented.

November 16, 2007

Launchball on the shell building

Author: Huy Dinh - Categories: Random - Tags: , , , , , ,

Launch ball, if you haven't heard of it, is a puzzle game created by some tallented people at my office. It was so popular that it crashed the server on the first day.

Today it was projected on to the shell building by the London Eye. How cool is that?

Launchball on shell building

Haven't played it? here you go: http://www.sciencemuseum.org.uk/launchpad/launchball

Bizzarly enough, someone's even created a walkthrough for it: http://www.facetiously.net/launchball

November 9, 2007

Hello world!

Author: Huy Dinh - Categories: Random

This marks the start of my geek blog... and the end of your journey if you're reading in reverse chronological order!

I'm not much of a blogger, it takes me too long to write anything interesting, so instead, this site is for me to show off my work and achievements.

I hope to post one blog every fortnight... but that may be ambitious, though, other sections will be kept up-to-date.

It may seem like the Contact page is missing information, this means that I'm not in the market.