Skip to content

Instantly share code, notes, and snippets.

View kimenye's full-sized avatar

Trevor Kimenye kimenye

View GitHub Profile
@kimenye
kimenye / MongoEngineGridFS Server
Created March 15, 2012 14:53
Serve GridFs files from mongo engine with flask
from flask import Flask, request, redirect, url_for, make_response, abort
from mongoengine.fields import get_db
from bson import ObjectId
from gridfs import GridFS
from gridfs.errors import NoFile
from <your_app> import app
@app.route('/files/<oid>')
def serve_gridfs_file(oid):
try:
@kimenye
kimenye / gist:1916174
Created February 26, 2012 11:23
Opensource GEO Utility to convert csv file to KML
def file = new File(args[0])
def mb = new groovy.xml.StreamingMarkupBuilder()
new OutputStreamWriter(new FileOutputStream(args[1]),'utf-16') << mb.bind {
mkp.xmlDeclaration()
mkp.declareNamespace( kml: "http://earth.google.com/kml/2.0" )
kml {
Document {
Folder {