Sometimes it’s nice to see which of your twitter friends are actually following you back. I like DoesFollow from @damon but I don’t want to go to another web page; I’d rather just click one button on a user’s feed and get the information immediately. I wrote a bookmarklet that does this for me.
Here’s the source:
myName = 'abhaykumar';
thisPage = window.location.href;
if ((new RegExp('twitter.com')).test(thisPage)) {
otherName = thisPage.split('/').pop();
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
if (typeof xmlhttp.overrideMimeType != 'undefined') {
xmlhttp.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} else {
alert("Your browser doesn't support XMLHTTPRequests and cannot use this bookmarklet.");
}
xmlhttp.open('GET', 'http://twitter.com/friendships/exists.json?user_a='+myName+'&user_b='+otherName, true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
response = xmlhttp.responseText;
if (response == 'true') {
alert('Yes, '+otherName+' is following your tweets.');
} else {
alert('No, '+otherName+' is not following your tweets.');
}
}
};
xmlhttp.send(null);
} else {
alert("It doesn't look like you are on a twitter page. You need to be in order to use this bookmarklet.")
};
To make you’re own, just replace first line and you should be good to go. Enjoy!
Ever do something like this in a Rails app and think it was really awesome and convenient?
all_content = Post.find(:all).map(&:content)
Symbol#to_proc is really neat but is expensive as heck.
Here’s some sample benchmarks:
user system total real
without to_proc 0.840000 0.000000 0.840000 ( 0.858780)
with to_proc 1.780000 0.020000 1.800000 ( 1.816275)
That means code that looks like this:
(1..100).inject(&:+)
looks really neat but is quite a bit slower than
(1..100).inject {|sum, n| sum + n }
ActiveRecord, your Ruby-Fu may be strong but it’s going to cramp my style.
I got this in my email today so I thought, why not? Use this 20% off referral code and I’ll have a chance to win an iPhone I’ve been coveting for about as long as everyone with one has been mocking me for not having it. The first place winner also wins a MBP but I highly doubt I’ll get that far. I’m fine with Top 5.
Design By Humans 20% Off Referral Code: abhay (Expires July 6 @ midnight)
The super awesome designs that I own:

pollution effect

Must Destroy The City

Memory Ln.

Circular Reasoning
The only unfortunate part of it is that you have to pay tax in CA. Bah!
I haven’t been able to download the new Firefox 3 package all morning so I went hunting for mirrors.
Here’s a direct link for those on Mac and wanting the en-US release: dmg, checksum
There’s a full mirror list where you can get more download links while the mozilla.org site stays up. You can find your platform and language via that list. More examples: linux-i686, win32
This post is mostly so I remember this myself but when I logged into my VPS this evening and tried to use yum, I got the following silliness
Could not retrieve mirrorlist http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-8&arch=x86_64 error was
[Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again
I’m not really sure what’s going on over there but I’m impatient.
I just modified the mirrorlist line in /etc/yum.repos.d/fedora.repo
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?path=pub/fedora/linux/releases/$releasever/Fedora/$basearch/os
Extra points
If you add country=us, to the mirrorlist url, you’ll get a more restricted repository list.