Skip to content

Instantly share code, notes, and snippets.

View erans's full-sized avatar
💭
Hiring developers in Oakland, thje Bay area and anywhere in the US!

Eran Sandler erans

💭
Hiring developers in Oakland, thje Bay area and anywhere in the US!
View GitHub Profile
@erans
erans / main.go
Last active May 15, 2023 10:51
Go Example: Google CloudSQL with CloudSQL Proxy and GORM
package main
import (
"github.com/jinzhu/gorm"
_ "database/sql"
_ "github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/mysql"
)
// You can read more in this post: http://forecastcloudy.net/2016/06/28/using-google-cloud-sql-from-go-with-gorm-in-google-container-engine-and-google-compute-engine/
func main() {
@erans
erans / get_lat_lon_exif_pil.py
Created May 20, 2011 21:16
Get Latitude and Longitude from EXIF using PIL
from PIL import Image
from PIL.ExifTags import TAGS, GPSTAGS
def get_exif_data(image):
"""Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags"""
exif_data = {}
info = image._getexif()
if info:
for tag, value in info.items():
decoded = TAGS.get(tag, tag)