automate linking to Twitter users
def link_twitter_user(txt) if match = txt.match(/.*?(@)((?:[a-z][a-z]+))(:|\s)/i) user = match[2] txt.gsub!(user, '<a href="http://twitter.com/' + user + '">' + user + '</a>') end txt end
11387 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
def link_twitter_user(txt) if match = txt.match(/.*?(@)((?:[a-z][a-z]+))(:|\s)/i) user = match[2] txt.gsub!(user, '<a href="http://twitter.com/' + user + '">' + user + '</a>') end txt end