Skip to content

Instantly share code, notes, and snippets.

@markmcdonald51
Created July 29, 2010 15:37
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 markmcdonald51/498448 to your computer and use it in GitHub Desktop.
Save markmcdonald51/498448 to your computer and use it in GitHub Desktop.
# A must have function for thinking sphinx, eg:
#
#Location.search("taco", :geo => [33.653275.to_radian, -117.646854.to_radian ], #:order => "@geodist ASC").map(&:address).map(&:city)
class Numeric
def to_radian
self * Math::PI / 180
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment