Coding with Jesse

Finding a job as a web professional

If you're a web professional looking for a job, or looking to find a better job, there are some really great job boards to keep an eye on:

  • 37signals Job Board

    This is a great site to find some of the best jobs out there. Many of them are looking for Rails developers, but there are other development, design and management jobs. Plus, I think it's a good sign when a company knows about 37signals.

  • jobs.rubynow.com

    Certainly the best place to find a Ruby On Rails job. There's new postings nearly every day.

  • Vitamin Job Board

    There's a nice variety of web professional jobs posted here, though mostly centred around development.

  • CSS Beauty

    If you're passionate about web standards and semantic markup, there's probably a good job for you on here. I bet it would be nice to work in a company where you don't have to convince anyone about the benefits of web standards.

  • craigslist

    If you know the city you want to work in, Craigslist is a great place to look for a job. It doesn't have every job, but in my experience the companies that post on there tend to be at least a little hip. The squares probably haven't even heard of craigslist.

  • Indeed

    Indeed's like the coolest job search out there. You can put together a complex search string and search across a number of job boards (including craigslist). Then, you can subscribe to the RSS feed for that search. This can be really great if you want to specialize in a particular technology or filter out all jobs mentioning ASP.NET.

When looking for a job, it helps if you either live in a great location like California, New York or London, or you're willing to relocate. Who knows, though, maybe your dream job is just around the corner.

I think all of these job boards have RSS available, so you can just subscribe now and keep an eye on the results while you mull over quitting your current job.

Published on August 17th, 2006. © Jesse Skinner

Avoiding Comment Spam with JavaScript

Originally I explained this on the Code Igniter forum, and since others are blogging it, I thought I should bring it here.

I guess I was nervous about sharing my anti-spam techniques on my own blog in case any spam bots are smart enough to read this article and somehow mutate and adapt. We'll see.

For a while, I had no problems with comment spam. Then I started to get a couple. Then one day I got like 50 at once, so I did something "extreme" - I made it so users have to have JavaScript to submit comments. I have a randomly generated spam key in PHP, and then use something like this on the page:

<form id="cform" style="display:none">
    <input id="txtauthor" name="<?= $spam ?>a"/>
    <input id="txtemail" name="<?= $spam ?>e"/>
    <input id="txturl" name="<?= $spam ?>u"/>
    <textarea id="txtbody" name="<?= $spam ?>b" rows="10" cols="40"></textarea>
    <input type="hidden" id="antispam" name="antispam"/>
</form>
<script type="text/javascript">
    document.getElementById('cform').style.display = 'block';
    document.getElementById('antispam').value = '<?= $spam ?>';
</script>
<noscript>Sorry, you need JavaScript to post comments.</noscript>

So if the spam key is 'xxxx' the author field is 'xxxxa', email 'xxxxe', etc. The spam key is filled using JavaScript. Then on the server side I do this:

if (isset($_POST['antispam'])) {
    $antispam = $_POST['antispam'];
    $cauthor = $_POST[$antispam . 'a'];
    $cbody = $_POST[$antispam . 'b'];
    $cemail = $_POST[$antispam . 'e'];
    $curl = $_POST[$antispam . 'u'];
    if ($cbody && $cauthor)
        addComment($id, $cemail, $cauthor, $cbody, $curl);
}

This has majorly cut down on the number of comment spam I get. I still get the occasional one here and there, but they must all be done by hand instead of with some automated bot.

Unfortunately, this method means that users without JavaScript can't post comments on here. I regret that, but since nobody posts comments on here anyways, I figure it's not such a loss. :) One day, I would like to add some kind of captcha or approval system to allow posting of comments without JavaScript.

Published on August 16th, 2006. © Jesse Skinner

The Desktop Web

That dynamic duo Tara Hunt and her PiC Chris Messina have got me thinking. They've been talking about web applications starting to move to the desktop. Okay, that doesn't seem so interesting, desktop applications are like the oldest things there are. But we've learnt some lessons from web apps that we can try to bring back to the desktop.

Tara asks:

I sync my iPhoto with Flickr and Riya - but why couldn't I store all of that data on my desktop?

Chris sees web apps coming to the desktop more literally:

I'm seeing a third generation stack emerging that holds a great deal of promise for sewing up the future of offline-sync-online experiences.

That stack looks a bit more like Rails, SQL Lite (which the next rev of the Firefox bookmarks will be based on), Microformats, some blend of JSON/AMASS/jQuery/behaviour.js/scriptaculous/prototype and, yes, WebKit. What do they have in common? Well, enough inter-woven stickiness to make the heart of a true web geek start to murmur.

This got me thinking about something nobody really talks or cares about anymore: peer-to-peer.

Why doesn't every computer on the web run it's own web server? If you want to share something with the world (photos, music, a blog, etc.), you put it on your personal web server and people come to you.

Try to do this today. I ran a web server off my own computer for a few years in University.. that is, until the assholes at Rogers Cable told me to block port 80 or they would cut off my Internet service.

Okay, I understand the logistical problems here. Even our high-speed Internet connections couldn't handle the bandwidth issues of a busy web site, let alone a dial-up connection. And we would have to leave our computers running all the time. We would also need a static IP or heavily use dyndns.com, plus I can't picture average Internet users configuring their router to port forward to their personal web servers, nor configuring Apache. Not to mention the security implications.

Okay, it sounds like a bad idea for 2006. But I'm talking about the future of the web here.

Eventually, I hope, our current bandwidth will be as funny as 2400-baud modems are to us now. Eventually, perhaps, IPv6 will let every device have a static IP so we won't have to hide behind our routers. Eventually, when a web server becomes as easy to set up as a web browser, we will find them in every household. Eventually.

Published on August 15th, 2006. © Jesse Skinner

Swift: Safari for Windows?

I just heard about Swift (via Chris Messina). Swift is a port of WebKit for Windows. WebKit is the rendering engine behind Safari (in the same way Gecko is behind Firefox and Mozilla). So I figure, sweet! Safari for Windows!

I had some problems though. On one of my PCs, WebKit.dll couldn't be registered so the installation failed. Weird.

On my other PC, I got Swift installed no problem. I ran it and.. well.. let's just say it's clearly Alpha software. Not only is the user interface extremely bare minimum (you're not going to make this your default browser any time soon), the functionality is a bit iffy. For example, it crashed when I clicked a normal link.

Perhaps it will help you see how WebKit will render your page.. but I wouldn't rely on it. I had a password field go missing, and buttons are styled with CSS whereas I'm pretty sure they aren't in Safari.

It seems there is also a problem with JavaScript. JavaScript executes, sometimes, but I had a problem getting popups to launch, or to load my new Google ads. Okay, maybe you won't miss popups and ads, but what else will break?

I give massive kudos to WebKit and Chris Fuenty for putting this together. It's not there yet, but I can't wait until it is. Having a port of WebKit on Windows will help web developers without Macs immensely. Maybe one day Swift will even become a major player in the browser market.

Published on August 14th, 2006. © Jesse Skinner

Let people turn off ads Part 2

As I warned yesterday, I've put ads back on the site. Currently, I only have them on the individual blog post pages (the pages that have comments on them). If you only read from the home page, or if you read via RSS, you won't see them.

I also walked my own talk by letting people turn off the ads if they wish. I did it entirely with JavaScript, so I thought I'd share my methodology with you.

The HTML just looks like this:

<div class="ads">
    <script type="text/javascript" src="banner-ad.js"></script>
</div>

And the JavaScript in banner-ad.js looks like this:

/* Customized Google Adsense codes */
google_ad_client = "pub-3809601305027895";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_ad_channel ="8087340205";
google_color_border = "99bbee";
google_color_bg = "99bbee";
google_color_link = "000000";
google_color_url = "000000";
google_color_text = "000000";

/* cookie functions from QuirksMode */
function setCookie (name,value,days) {
    if (days)
    {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}

function getCookie (name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++)
    {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

/* onclick function to remove ads */
function removeAds() {
    /* set a cookie for 10 years to stop showing ads */
    setCookie('hideads', '1', 365*10);

    /* hide every div on the page with the class name 'ads' */
    var ads = document.getElementsByTagName('div');
    for (var i=0;i < ads.length;i++) {
        if (ads[i].className == 'ads') {
            ads[i].style.display = 'none';
        }
    }

    return false;
}

/* don't show the ads if the cookie is there */
if (getCookie('hideads') != '1') {
    /* write out the link to hide the ads */
    document.write('<a href="#" onclick="return removeAds()">Remove Ads</a>');

    /* write out the regular Adsense script tag */
    document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');
}

When the 'Remove Ads' link is clicked, the ads are instantly hidden using CSS and a cookie is set. Next time this script is loaded, as long as the cookie is set, the ads won't be written to the page anymore.

Published on August 13rd, 2006. © Jesse Skinner
<< older posts newer posts >> All posts