• This blog is related to "Cartoon Porn"

    Got this in my email recently:

    Respected Webmaster,

    I found your page on Yahoo! when I was searching for Free Cartoon Porn (this topic is related to my site). You are running a great website and I would be happy to place your link on my site. If you would like to exchange text links with me, please submit your website on deleted link

    I'm sure you know that links exchange will help both of us to get better positions on search engines and have more visitors to our websites.

    I went to Yahoo! and searched for "free cartoon porn redemption" and sure enough, that link was up there. A bunch of comment spam qualified my site for a link exchange, yippee! I was pretty amused.

  • Beware of form parameters named 'submit'

    Well, that is if you are ever going to be submitting the form via Javascript. We had to generate forms on the fly and POST them behind the scenes (i.e. in hidden <iframe>s), and got a decent script going, until a particular case failed for no apparent reason. I finally found that the problem was due to a form parameter named "submit" that overwrote the submit() function of the <form>. That's, of course, after looking at all the wrong places.

    So this doesn't work:

    <form id="ninjaForm" action="/come/get/some" method="post">
      <input id="someParam" name="someParam"
        type="hidden" value="Some value" />
      <input id="submit" name="submit"
        type="hidden" value="Start search" />
    </form>
    <script type="text/javascript">
      setTimeout("document.ninjaForm.submit()", 200);
    </script>

    When the browser tries to execute "document.ninjaForm.submit()", it sees the "submit" form field (which overwrote the submit() function) instead and complains that "submit is not a function".

    Do this instead:

    <form id="ninjaForm" action="/come/get/some" method="post">
      <script type="text/javascript">
        // Alias the submit function in case there is a 'submit' param.
        ninjaForm = document.getElementById('ninjaForm');
        ninjaForm.__submit = ninjaForm.submit;
      </script>
      <input id="someParam" name="someParam"
        type="hidden" value="Some value" />
      <input id="submit" name="submit"
        type="hidden" value="Start search" />
    </form>
    <script type="text/javascript">
      setTimeout("ninjaForm.__submit();", 200);
    </script>

    That's one way to workaround, of course, and we can get away with the "ninjaForm" global in this case.

  • Application error (Rails) on Google search results

    I did a search on Google for "Rimuhosting" today, some time after I signed up with them, and hey, there's my blog in 3rd spot - is that some mad SEO skillz or what. And then "oooh, there's an 'Application error (Rails)' result coming out, that's not good".

    'Application error (Rails)' on Google


    I thought it was amusing - Google must have crawled my site just as I had deployment troubles (yeah it was a smart move leaving MySQL to it's default settings and using the InnoDB storage engine on a memory-starved VPS). All seems fine now though I'm still somewhat amazed at the hungry Mongrels (at 25-40MB per Mongrel process, these things run more like St. Bernards). (A shout out to Ryan Daigle who has been giving me some Rails deployment advice.)

    By the way, the "mad SEO skillz" comment was a joke, I wasn't at all surprised to be honest, Google just loves blogs (and they still do, after all this time of I've been not blogging).

  • Ruby on Rails satire blog

    Javac programmers are Very Slow and he is Agile

    My Rails Blob pokes fun at the cult of Ruby on Rails via satire. Recommended blog posts: Rubby Links on the W.W. w. and Upgradeing Rails: Securiety through Obscenity [sic]. I've subscribed to the RSS feed.

    NO! - Bad User!!!

    The Daily WTF has this monthly collection of hilarious pop-up error blunders, and as usual this month's a gem: Pop-up Potpourri: Announced By God. Must read.

    Developers would find this particularly funny (I did):

    Bad user!


    And this one's for my boss, Gary (remember the 'Abort/Retry/Ignore' you saw at the MRT station?)

    Next stop: null
  • Extract Any Archive with Ruby, Slimtimer, Feedalizer

    A bunch of cool stuff I found over the weekend that didn't individually deserve a blog post, but I thought would be worth sharing.

    Extract Any Archive with Ruby

    This is really neat if you could never remember what commands or command-line arguments you need to extracting archives (.zip, .tar.gz, .tar.bz2 - those kinds of archives).

    With this Extract Any Archive script written in Ruby, instead of

    tar jxvf DonkeyPr0n.tar.bz2

    you can simply do

    e DonkeyPr0n.tar.bz2

    Instant gratification!

    Slim Timer

    SlimTimer is one another of those productivity-keep-track-of-your-todo-list type applications - I like it because seeing the time ticking away gets you motivated on sticking to the task at hand. You can stick it into your Firefox sidebar and all that AJAX-y stuff makes it behave like a normal application.

    SlimTimer running in a Firefox Web panel


    Feedalizer - transform web pages into RSS feeds

    Choon Keat pointed this out to me recently: Feedalizer (backed by Hpricot). I played around with it and it was so easy (and fun) to use. Whipped up a Mongrel news feed (code) for Mongrel news (which didn't have an RSS feed). The hardest part was figuring out which Hpricot methods to use to parse the bits I needed.

    Served by Apache 2.2, mod_proxy_balancer, and Mongrel

    I got off my butt and set up Apache 2.2 with mod_proxy_balancer to load-balance a cluster of Mongrel processes, if you're still seeing this, that means it hasn't crashed, yet :p. Just kidding heh - I'm finding this setup pretty stable, though there was once the mongrel processes seem to have been over-loaded with requests (with 96MB RAM I can only run 2 processes, and even then I run out of memory real fast due to automated comment spam - does anyone have any solutions to blocking automated comment spammers before they even hit your website?).

    In any case, I learnt quite a bit as I was setting up my deployment environment for Rails, and hopefully someone will be able to benefit from that when I finish my post on the topic.

subscribe via RSS