This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Use this snippet to add a google map location chooser to your form | |
Step 1: Get a google map api key and insert it in the first javascript tag | |
Step 2: In your html form, create two hidden elements, one for latitude, and one for longitude. Give the elements ids and set the LATITUDE_ELEMENT_ID and LONGITUDE_ELEMENT_ID to the appropriate variables | |
Done! | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ConvertImagesToPaperclip | |
def self.convert_all | |
# Update table information | |
Photo.reset_column_information | |
# Delete all attachement_fu image sizes | |
Photo.delete_all("parent_id IS NOT NULL") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
code for checking if a polygon is cockwise or counter-clockwise | |
There are two versions: | |
is_clockwise_convex only works for convex polygons -- but is faster, | |
it only needs to check three points. |