Skip to content

Instantly share code, notes, and snippets.

@natebenes
Created September 2, 2011 20:45
Show Gist options
  • Save natebenes/1189867 to your computer and use it in GitHub Desktop.
Save natebenes/1189867 to your computer and use it in GitHub Desktop.
def profile_pic(email,size)
digest = Digest::MD5.hexdigest(email,size)
# we want to allow parallel downloads,
# but we don't want to bust caches
if(%w(0 1 2 3 4 5 6 7).include? digest[0])
host = "img0"
else
host = "img1"
end
return "http://" + host + ".lnkherd.com/avatar/" + digest + "?s=" + size + "&r=pg&d=retro"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment