Skip to content

Instantly share code, notes, and snippets.

@madpilot
Created February 1, 2012 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madpilot/1715865 to your computer and use it in GitHub Desktop.
Save madpilot/1715865 to your computer and use it in GitHub Desktop.
GeoIP.new(File.join(Rails.root, 'db', 'localization', 'GeoLiteCity.dat')).city(request.remote_ip)
=> ["203.59.95.220", "203.59.95.220", "AU", "AUS", "Australia", "OC", "08", "Perth", "", -31.9333, 115.8333]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment