Archive for the ‘webdev’ Category

Words of wisdom

Tuesday, February 23rd, 2010

Keep this in mind the next time you have to work on somebody else’s code:

So I am a bit lucky in that my father is a very experienced programmer who also gave me the bug. One of the first things he said to me when I started programming for more than just fun or OSS, was that he never judged other programmers code. He would correct it, point out flaws in it, but always with a suggestion of how to do it better. The reason for this is that in the world that we have to live in, of deadlines, PHBs and evil marketing folks who spring new features on a development team right before a release, you never know why someone’s code is the way it is.[...]

source: mprorock on reddit

Nieuwe site NOiV gelanceerd!

Tuesday, January 12th, 2010

NOiv website
De nieuwe website voor Nederland Open in Verbinding (NOiV) staat live. Tezamen met het Utrechtse bedrijf Eend heeft Burobjorn de website van NOiV op basis van Wordpress Mu ontwikkeld. Hierbij was Burobjorn verantwoordelijk voor het opzetten van Wordpress Mu inclusief de structuur, het ontwikkelen van op maat-gemaakte functionaliteiten zoals een filter systeem en het omzetten van de door Eend aangeleverde HTML en CSS (conform de Webrichtlijnen) tot Wordpress templates. Het ontwerp van de site is door Maaike de Laat ontworpen.

Recognizable for every web developer

Friday, November 27th, 2009

Most webdevelopers I know are no fan of Microsoft’s Internet Explorer. It has become a lot better with Internet Explorer 8, but still Internet Explorer usually doesn’t play nice and in general it is hard to debug issues on Internet Explorer.

So here’s a song (see also the embedded movie at the end of this post) by a guy who definitely has experienced these issues and wrote a song about Internet Explorer being mean again. This one is for al you web developers out there. Have a nice weekend! (more…)

Released Wordpress plugin bbRedirector

Tuesday, November 24th, 2009

I’ve just released another Wordpress plugin. This one is called bbRedirector:

bbRedirector makes it easy to redirect a page to another location using absolute urls from within Wordpress. No mod_rewrite nor .htaccess is needed. You just create a page, add a specific customfield and choose the redirect template included with this plugin. It even allows you to set the required http status code (302 or 301). You can also set a default sitewide redirection or setup your own custom redirection.

The included templates should give you an easy start using this plugin.

Download the plugin from http://wordpress.org/extend/plugins/bbredirector/

New Creative Commons NL site launched

Monday, September 14th, 2009

ccnl-homepage

Today I’ve launched the new Creative Commons Netherlands (CC NL) website. CC NL asked me to make their website more similar to the creativecommons.org version, which I did and the result can be viewed online. We used the USA design (thanks to the USA webteam!) as a guideline and tweaked it until we were satisfied. A more in depth posts will be posted in the portfolio after the dust settles.For now I’m too occupied with finishing other projects.

Wordpress simple redirect

Tuesday, September 1st, 2009

Recently I needed an easy way for a client to create a link in a Wordpress powered website that would automagically redirect a visitor to a certain location upon visiting. Part of the requirement was that this link could be easily remembered and used in printed material such as leaflets and magazines. As an extra option it should be easy to change the location towards the redirection would point. I couldn’t find anything like this so I created a very simple little page template.

How it works:
Copy the template page Page Redirect code below to a file and save it as page-redirect.php in your own template’s directory. Create a Page in Wordpress and set the Page’s template to Page Redirect. Add a custom field to this page with the name redirect_url and the full url of the url you want to redirect to.
For instance: http://www.redirected-location.com. Now save the page and you should now test it by visiting the page you created.

For example (I assume you are using nice urls):

http://www.your-website.com/the-page-title-of-the-page-with-the-redirect-template

If all went well you should be instantaneously be redirected (using a standard php redirect with a 302 HTTP redirect) ) to the url you entered in the custom field. You can easily change the redirect location by changing the value of the custom field.

Code:


< ?php
/*
 * Template Name: Page Redirect
 *
 * Makes it easy to redirect a page to another url, using the parameter redirect_url
 */
$redirect_url = get_post_meta($post->ID, "redirect_url", true); 

// Defaults if no options we're given
if( ! empty($redirect_url) ) {  header("Location: $redirect_url"); } else { echo ""; }
/* Make sure that code below does not get executed when we redirect. */

exit;
?>

As I said it uses the standard PHP redirect, but you could easily change or extend it with more specific http headers if needs arise. Feel free to use the above snippet as you see fit, as far as I’m concerned it’s in the public domain. I hope this might be useful to you. If you have any questions, feel free to leave a comment.

Add-ons for Mozilla Firefox and Thunderbird

Sunday, August 30th, 2009

mozilla-dragon-from-archive-mozilla-org

(source: http://www-archive.mozilla.org/party/2000/mozilla2.gif)

I’m an avid user of Mozilla Firefox for browsing the web and Mozilla Thunderbird for reading up email when I’m not in a commandline Mutt kinda mood. Out of the box these applications are already great to use, but by installing some add-ons it gets even better. So I made a list of all the add-ons I regularly use.

Frankly, without these add-ons I would not be able to do my work as a web developer nor would I enjoy the web as much as I do. In fact, without the Thunderbird add-ons I would not be able to keep track of appointments nor would I be able to archive emails in a sane and time saving manner. In other words these add-ons are lifesavers and perhaps you might find them just as useful as I find them. So have a look at:

I plan on updating these collections with future add-ons when I come across new add-ons.

If you know of great add-ons which should be part of the above mentioned collections feel free to leave me a comment below. I won’t promise to make them part of it, but if I find them useful to me I will add them. Otherwise you can easily create your own collections at Mozilla and ignore me :)

Eindelijk! Oude site vervangen

Friday, June 26th, 2009

Screenshot oude site

De nieuw site is nog niet helemaal klaar, maar ik kon niet meer wachten met het vervangen van de eerste zeer minimale oude site en de daarna bekende Apache default pagina. Steeds vaker kreeg ik (terecht!) vragen en opmerkingen over mijn eigen site en ik begon mijzelf er ook aan te irriteren dat mijn webstek nog altijd in de steigers stond. Daarom vanaf vandaag een nieuwe site waarbij er nog even flink gesleuteld moet gaan worden aan de inhoud en de techniek. Desalniettemin denk ik dat dit al een grote verbetering is.

Quick howto using Virtualbox with webdevelopment

Friday, March 27th, 2009

I use Virtualbox (version 1.5.6_OSE) on Ubuntu Hardy with Windows XP as one of the (guest) virtual machines. In order to access my webserver installed on the host (real physical system (Ubuntu Hardy) I need to use the ip-address 10.0.2.2 (I use NAT in Virtualbox’s network settings) from Windows XP (or any other guest operating system) and edit the hosts (c:\windows\system32\drivers\etc\hosts) file with the Virtual Host names I use on the host. This allows me to access the Virtual Host based websites to be accessed from the Windows XP operating system.

An example hosts file on Windows XP:

# make sure there's at least one space between the ip-address and the virtual host name
127.0.0.1 localhost
10.0.2.2 SOME_VIRTUAL_HOST_NAME

Replace SOME_VIRTUAL_HOST_NAME with a real Virtual Host name. In my case I use the extension .dev to indicate a local project in development, so it could be something like burobjorn.dev

Internet Explorer and “Operation Aborted”

Friday, March 20th, 2009

I was working on a website for a client when we discovered that sometimes the website was not accessible for Internet Explorer. Notice the word sometimes.

A word dreaded by every programmer including myself. In order to solve problems there needs to be a pattern. Something like: “press the red button and the screen goes blank”. Without the ability to reproduce a problem it is really hard to solve the problem or confirm that the actions you took to solve it were indeed the (right) solution and not some fluke.

In this case a user visited the website and got access to it, or the user visited the site and got an arcane error message:

“Internet Explorer cannot open the Internet site http://<Web site>.com. Operation aborted.”

I never saw this message before and after some testing we could confirm it only happened with Microsoft Internet Explorer. There were no problems with any other browser, but somehow Internet Explorer sometimes spat out this utterly useless error message and prevented the user to visit the client’s website.Together with some engineers from the hosting company I sat out to find and solve this issue. So we started to have a look at the web server’s  log files.

At first the engineer from the hosting company suspected it might have something to do with some HTTP 500 error codes, missing images (so you would expect HTTP 404 errors) and some rewrite rules. According to his first thesis this combination might have caused a redirection loop and Internet Explorer could not cope with it. After quickly fixing the missing images (a typo in a path) we could dismiss this thesis and we continued our quest. Luckily a colleague of one of the engineers remembered a similar issue creeping up with a different client of them and pointed us in the right direction. A quick search (note to self don’t try to be smart, first search for the error message on the Net, then analyze logfiles) later gave use quite a lot of links pointing towards Microsoft.

Apparently Microsoft’s engineers think that its a good idea to confront a user of their browser with an arcane error message and prevent the user from accessing the website when the visited website in question does something less smart (maybe even stupid). While any other browser would at least try to let the user access the website and cope with the issue. I wonder where the Interaction Design people were during this decision.

No, I’m not making this up. Microsoft states in the knowledgebase article on this issue: “This behavior is by design.” What are the arguments for doing it this way? Interestingly in the same article they claim:

How do I fix this problem?
The easiest way for you to fix the problem is to upgrade to Internet Explorer 8. This problem no longer occurs in Internet Explorer 8.

So the behavior is by design, yet they advice you to solve it by upgrading your browser. Interesting, to say the least.

Anyway, after reading the article and doing some more debugging (which is a lot more painful then it ever should be using Internet Explorer) I found the culprit to be a piece of JavaScript (swfobject.js in this case) trying to access an element before the parser was ready. A bug and certainly something we needed to fix, but Microsoft did you really have to abort loading the webpage and preven the user from accessing it? Why can all the other browsers cope with this and still allow the user to visit the website? Would it have hurt to show a less obtrusive error message in the status bar?

For those having similar issues please see these urls for more info:
http://support.microsoft.com/kb/927917/
http://blogs.msdn.com/ie/archive/2008/04/23/what-happened-to-operation-aborted.aspx