Category: Web

link
1

This image “evolution” simulator would be a good benchmark for the up‐and‐coming JavaScript engines… but, sadly, Google Chrome doesn’t yet support Canvas#getImageData. Anyway, both Firefox 3.1b2 and the latest WebKit nightly do very well.

link

No Labs Love for Google Apps. This domain’s e‐mail account is hosted by Google Apps — and I use Mail.app to read my e‐mail — so the fact that GApps seems to be branched off from all the cool Gmail features is an annoyance for me, too. Good to hear that someone’s trying to fix it.

code

Auto-format Tweets

Used on my “About” page.

(function() {  
  var USERNAMES = /@([A-Za-z0-9_]*)\b/;
  var URLS      = /https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.]*(\?\S+)?)?)?/;
  
  function getInnerText(element) {
    element = $(element);
    return element.innerText && !window.opera ? element.innerText :
     element.innerHTML.stripScripts().unescapeHTML().replace(/[\n\r\s]+/g, ' ');
  }
  
  function linkifyTweet(li) {
    var html = li.innerHTML, text = getInnerText(li);

    text.scan(URLS, function(match) {
      html = html.sub(match[0], '<a href="#{0}">#{0}');
    });    
    html = html.gsub(USERNAMES, '<a href="http://twitter.com/#{1}/">#{0}');
    li.update(html);
  }
  
  function init() {
    $('twitter').select('li > span.tweet').each(linkifyTweet);
  }  

  document.observe('dom:loaded', init);  
})();
thought
4

Vote! Decisions are made by those who show up.

quotation
2

I see this as a potentially promising post‐election wedge issue for the GOP — surely they’ll be able to get substantial support from moderate Democrats for a Federal Pant‐Sagging Act (FPSA) and then dare Obama to issue an unpopular veto.

Matthew Yglesias
quotation

The rules are explicit here — if you have consensual sexual relations with anyone not legally old enough to consent to such behavior, it’s statutory rape regardless of whether they turned themselves into an adult by making a wish to a Zoltar machine. [Elizabeth] Perkins’ character worked with Josh Baskin (the Tom Hanks character) in New York City when the age of consent was 15 years old. Well, Baskin was only 13 at the time. So there you go.

Bill Simmons

Animating the YouTube Arrow

Posted in JavaScript, Web

Whenever I drift into one of my twice‐weekly YouTube stream‐of‐consciousness video‐watching binges, I let myself be bothered by a small, inconsequential nitpick. Here’s the “Related Videos” heading in its collapsed state: And here it is in its expanded state: Though there’s no animation between these two states, I’ve always considered

Read more →