Skip to content

Instantly share code, notes, and snippets.

@michaeldelorenzo
Last active December 14, 2015 07:19
Show Gist options
  • Save michaeldelorenzo/5049955 to your computer and use it in GitHub Desktop.
Save michaeldelorenzo/5049955 to your computer and use it in GitHub Desktop.
Regex to update picture URL to 'normal' sized.
var large_photo_url = options.picture_url.replace(/_[a-z]\.[a-z]{3}$/i,
"_n"+options.picture_url.match(/\.[a-z]{3}$/i)[0]);
large_photo_url = picture_url.gsub!(/_[a-z]\.[a-z]{3}$/i, "_n#{picture_url.match(/\.[a-z]{3}$/i)[0]}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment