CODEgrunt blog

Commentary and insight on web development and the Internet at large written with a wry smile and a hungry look.

MonerisHPP payment module for Prestashop - Fri Sep 03, 2010

For those looking for a potential shopping cart Prestashop is a cleanly written and actively supported codebase which is a compelling alternative to the other FOSS cart options. From this programmer's point of view it is the nicest internally and generally much easier to modify than other aging systems like osCommerce or Zen-Cart. However, being newer and originating from Europe means that Canadian merchant processors like Moneris are not supported out of the box either as a free or paid module.

To help with this situation I am making available the Moneris HPP (Hosted PayPage) module that I have written. This module allows shops to accept of payments using Merchant Processor Moneris' "Hosted PayPage" service. This module has been confirmed to work with Moneris Canada. The module is available free of charge but donations are also welcome if you feel like the module has helped you out.

If you require support or want assistance with integration then my normal consultation rates apply (contact me for a quote).

Download Moneris HPP Payment Module For Prestashop (tested with Prestashop 1.3.1)

As an aside, this module has also been submitted to the Prestastore site but as the approval process is taking inordinately long, I am posting locally here in case anyone needs to get a Moneris site rolling and cannot wait.

the joys of disabling Javascript - Mon May 31, 2010

I suppose that I am paranoid by nature, at least with respects to web technologies. Javascript for example is obviously a powerful, feature friendly way of creating dynamic content but the idea of client side scripting that is not under the user's control has always made me a little nervous (the vast majority of browser exploits rely on it for example). So my default browsing environment is with ads blocked and Javascript disabled.

More and more these days I am seeing artifacts of new school web designers either confusing or forgetting that client side is not under their control and that not everyone (or every thing such as the plethora of bots out there) sees the world through rosy Javascript coloured glasses. Take the NHL's web designers for a Javascript-less ride and we get this:

nhl.com with Javascript disabled

What's in the red circle? Let us take a look:

nhl.com with Javascript disabled says "values were inserted here in example"
//values were inserted here in example

It is hard to tell whether someone was taking "copy and paste" too literally or whether a 3rd party is injecting content they should not be but none the less, it makes for an amusing and informative Google search.

The obvious lesson is do not forget to test your code with Javascript disabled because at the very least Google will.

The hunt for a Linux friendly MP3 player: Philips GoGear Muse - Tue Jan 05, 2010

Linux has been my primary desktop OS now for close to a decade, originally via Gentoo but for the last while now I have been sticking with the less attention demanding Kubuntu. As pleasant as the Linux experience generally is, one unfortunate downside is that the two most prevalent MP3 players out there require proprietary software to use - there is no iTunes or Windows Media Player available for Linux. This forced vendor lock-in immediately takes the iPod and Zune out the running when looking for a new device to help you rock some tracks while out and about.

When looking for cross platform media players, the magic acronym you want to hear is "MSC" (Mass Storage Class) which means that the drive will be mountable as a standard removable drive. "MTP" (Media Transfer Protocol) can be hit or miss due to lack of standardization so has less chance of working. An article over at the venerable British tech rag The Register suggested that the Philips GoGear Muse had decent support for MSC mode and should be a suitable option for those running Linux.

Now I was fairly late to the PMP (portable media player) party so my first device was a 16GB Sansa View. Forgotten and unsupported by the manufacturer with terribly written firmware (OS crashes, bugs, poor power management, you name it), the View should be the textbook example of how not to implement an MP3 player. I cannot speak for Sansa's other products but I for one will never buy another MP3 player from them. But hey, at least I now have a low water mark to compare against.

With my frustration with the View finally bubbling over and a need for a reliable player, I wandered down to the local Future Shop outlet and picked up a 16GB Muse for $100 CAN (plus taxes).

Note: this review is an ongoing project.

My main uses for the Muse are feeding music to a PA for in between performances, fuelling a small portable PA for group bike rides and for listening to music before going to sleep via the RCA ins of a small ghetto blaster. For these uses this player has performed well enough that I am not seeking a replacement.

For a hundred clams (at least in my town) your MP3 options are often fairly limited. The Muse is not perfect but for that price of entry I can recommend it to those looking for a Linux friendly player who do not require a loud audio output. If the Muse could generate a better volume level and if the random play was less prone to repetition my prognosis would be glowing. As it stands, this player has given me my money's worth and I will definitely consider Philips when I need a replacement.

Pros

  • on device playlist support
  • good format support including OGGbattery life is usable
  • nice display
  • standard mini USB connector
  • on device database generation handles missing ID3 tags gracefully
  • mounts in MSC mode with Kubuntu 9.* and 10.*
  • sleep timer

Cons

  • "random" play is not as random as it should be
  • rather anemic output level (volume much too low)
  • lack of a compressor (volume limit helps but aggravates the already low output volume
  • occasionally does not seem to shut down properly
  • long boot up time
  • device does not currently work with Amaraok 2.*
  • sleep timer rudely cuts off which can cause audible glitching instead of fading out gracefully

topics: review

ISO country list, where art thou? - Wed Dec 30, 2009

While rewriting an old codebase of mine I decided that I should re-think how I was storing country data and switch to using country codes directly since those are standardized, immediately obvious when looking at the data and just as indexable by MySQL as numerical Indices. My old HTML piped through Awk generated MySQL table does not contain country codes so off to Google I went. Well somewhat surprisingly there are a lot of bad answers out there as to where to find an official list of country codes.

To hopefully safe time for those on the hunt, the official list of country codes can be found here:

The data is available in a number of formats including XML, plain text and viewable HTML.

topics: programming

carriage returns are false metal - Mon Nov 16, 2009

Ahh, carriage returns how I love thee. Today I managed to waste around 20 minutes banging my head against some very simple Javascript used to open a new window when the user clicks a link:

<a href="http://codegrunt.com" onclick="window.open(this.href); return false;">this is a link</a>

Trivial code, user clicks link and new window opens up. If life was only that simple - instead of the desired behaviour, the original URL was also firing and causing the originating window to load the URL as well. Arrrgh.

Can you see the bug? It is a trick question really as you would have probably have to view the source to notice it. The problem was a stray carriage return after "return" which causes Javascript to skip the return value of "false" and happily follow the link in both the current page and a new window. Now normally this would have been immediately obvious to me but my IDE is set up to nicely linewrap long lines which normally is pure awesome but unfortunately tricked me today when high LCD contrast (and perhaps not enough coffee) made the grey line wrap less obvious.

I hate these situations, something so simple going inexplicably astray. It becomes so easy to spiral off on dangerous tangents, "Oh no, maybe NoScript is doing something funny. . ." or "Crap, I bet something buried in an external library is messing with events!" Time consuming goose chases which could easily create their own mess as you wade frantically through trying to solve an issue that seems both impossible and ridiculous.

It has been a while but I again know how it feels to get punked by carriage returns.

blog

CODEgrunt consulting

Experienced PHP web developer.

$35 an hour, no job too small.

There is no replacement for integrity and experience.

Contact me for more information.

calendar

September 2010

Sun
Mon
Tue
Wed
Thu
Fri
Sat
29
30
31
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
1
2