Mr Speaker

mrspeaker's head in a monitor You find yourself at the entrance to the Hompage of Mr Speaker. In a darkened corner sits a trunk containing HTML5 games and some JavaScript tidbits. Next to it you spy a mastodon account. Exits are North, East, and .

Critical jQuery Info: How to pronounce “live”

After weeks of debate an answer has emerged. Live rhymes with "jive"? Or live rhymes with "give"?... that was the discussion point that was starting to turn ugly... In the live/jive corner: the "live" event is always on - like a live broadcast. In the live/give corner: the corresponding remove event is called "die", so it's "live & die".

After finally getting fed up of saying "...just use the live/live event", @twalve realised that our heros are merely a single tweet away and hit up Brandon Aaron for the answer... and here it is:

Read on for more »

Decision making

  1. Teenage Turtle Mutant Ninjas
  2. Ninja Mutant Teenage Turtles
  3. Turtle Mutant Teenage Ninjas
  4. Teenage Ninja Turtle Mutants
  5. Turtle Teenage Ninja Mutants
  6. Ninja Turtle Mutant Teenagers
  7. Mutant Turtle Ninja Teenagers
  8. Ninja Teenage Turtle Mutants
  9. Mutant Teenage Ninja Turtles
  10. Turtle Mutant Ninja Teenagers
  11. Mutant Teenage Turtle Ninjas
  12. Teenage Ninja Mutant Turtles
  13. Ninja Turtle Teenage Mutants
  14. Mutant Ninja Teenage Turtles
  15. Teenage Mutant Turtle Ninjas
  16. Turtle Ninja Mutant Teenagers
  17. Teenage Turtle Ninja Mutants
  18. Mutant Turtle Teenage Ninjas
  19. Ninja Teenage Mutant Turtles
  20. Ninja Mutant Turtle Teenagers
  21. Turtle Teenage Mutant Ninjas
  22. Mutant Ninja Turtle Teenagers
  23. Teenage Mutant Ninja Turtles
  24. Turtle Ninja Teenage Mutants

Closures with self-invoking functions

Just a quick note-to-self... I'm a big fan of using self-invoking anonymous functions to keep stuff out of the global namespace, but I forgot that they are also nifty for keeping variables in scope via closures. Here's the problem... Let's say with have an array that we'd like to populate with functions. The functions simply log their index to the console:

Read on for more »

Using jQuery on JavaScript objects (Part 1)

Today I was trying to decouple some JavaScript classes in a game prototype I've been working on. I didn't want to get into implementing some kind of interface behaviour, and so I thought about a simple Observer pattern. There are a bunch of solutions around the tubes (and indeed I'll probably use one of them) but I started wishing I could just use jQuery's custom events directly on my JavaScript classes.

This idea seemed pretty wacky to me, and made me smile: jQuery events attach themselves to DOM elements - wrapping a JavaScript object in the jQuery selector seemed ludicrous - I mean, should I be able to do $(class).hide()?! No, of course not. But none the less, my curiosity got the better of me, and I tried this lil' snippet:
Read on for more »

Esrever ni sdrocer gniyalp

spinnin' records
I'm getting pretty sick of people coming up to me on the street and asking how they can play their records backwards to hear the devil. "I can't spin it backwards at a constant rate" they cry, "and I get tired after a while. What can be done?!". It's upsetting that this problem still plagues our society when the solution - past down from drunken uni student to drunken uni student for decades - is easy, and requires fewer household items than an average Curiosity Show experiment.

Read on for more »

Game of Life

Game Of LifeConway's Game of Life is a simple cellular automaton based on a few simple rules. There's about fifty gabillion implementations of it around. Here's mine: Game Of Life in Javascript (rendered, of course, on Canvas). I just followed the rules on the Wikipedia entry, so I'm not 100% sure it's fully "Game Of Life Compliant", but it seems right...