Lucien’s Techie Blog

Free JavaScript book.

June13

I have too many JavaScript books, and I just bought a new one, so I want to get rid of some old books.

The first one on offer is the Sitepoint book “The Art and Science of Javascript“. This is a great book, and the chapter on Meta-programing rocks.

So how do you get your hands on this free book?

I only have one copy, so I have to find some way of choosing who to give it to. And I want to make if fun. So how about a little competition?

Send me a JavaScript file, and the one I like the best, wins! I’ll even pay the postage.

How will I judge? Err.. I like fun things. If it makes me smile, you’re in with a chance.

I’ll run the code in this page to test it, and just in case you were wondering, there are no frameworks to leverage off. Your code must be completely self contained. And I’ll test with Firefox 3

What’s the catch?

Of course there is one. The catch is that you have to send me your JavaScript via Twitter. That’s right, it has to fit inside the Twitter 140 character limit, and I guess that includes addressing it. My Twitter handle is @nedlud. But to save a little space, I think I’ll allow a #JS tag. Include #JS in your code (*instead* of address it to @nedlud) and I should be able to find it on Twitter. The #JS tag seems to get a fair bit us use, so I’ll look for things that look like pure JavaScript code only. I’ll DM the winner so I can get a mailing address from them.

Use @nedlud if you want to be sure I get it.
Use #JS if you need to save those extra 4 characters.

Since it’s Twitter, and everything is so *now*, I’m only going to leave this little competition open for one week. Today is Saturday 13 June, so I’ll take submissions only up to Saturday 20 June.

Good luck.

posted under TwitCode, Uncategorized
5 Comments to

“Free JavaScript book.”

  1. On June 14th, 2009 at 2:21 pm pimaster Says:

    grrrr.
    Currently at 217 chars for something that looks interesting.
    My biggest problem is by the time I get the element, and loop over content, I’m already at 143 chars.

  2. On June 14th, 2009 at 2:26 pm lucien Says:

    This is what I posted on twitter as an example… e=this.document.getElementsByTagName(‘p’)[0].firstChild;e.data=e.data.replace(/m/gi,’#JS’);
    It weight in at only 96 characters, *and* it already contains the #JS tag so it can be found. As to whether it’s “interesting”…

  3. On June 14th, 2009 at 3:24 pm pimaster Says:

    So here was my first attempt that I’ve given up on:
    s=v().innerHTML.split(” “);r=”";for(i=0;i<s.length;i++){r+=’<a style=”color: #’+((s[i].length<’+s[i]+’ ‘}v().innerHTML=r;function v(){return document.getElementsByTagName(‘p’)[0];}

    At first the colours were randomly chosen, but I tried to shorten it.

    The next attempt:
    v().position=’relative’;t=0;l=0;function m(){v().top=t+a()+’px’;v().left=l+a()+’px’;setTimeout(‘m()’, 200);}function a(){return Math.floor(Math.random()*3)-2;}m();function v(){return document.getElementsByTagName(‘p’)[0].style;}

  4. On June 16th, 2009 at 1:59 pm lucien Says:

    We have three entrants so far :)

    All worthy. Two were sent via Twitter, and the 3rd via Facebook, but it met the criteria of *being able* to be sent via Twitter, so I accepted it (and since it was from a good friend ;) )

    4 days to go. How many more scripts?

    If there is not too many, I’ll post them al online once it’s done.

  5. On July 12th, 2009 at 9:38 pm Lucien’s Techie Blog » TwitCode Challenge, the second Says:

    [...] challenge is much like the first one, but this time I have made jQuery available. I’ve also changed the structure of the target [...]