Skip to content

Instantly share code, notes, and snippets.

function(doc){
index("default", doc._id);
if(doc.min_length){
index("min_length", doc.min_length, {"store": "yes"});
}
if(doc.diet){
index("diet", doc.diet, {"store": "yes"});
}
if (doc['class']){
index("class", doc.['class'], {"store": "yes"});
@drsm79
drsm79 / cities.py
Created September 17, 2011 08:07
Cities parsing script
# encoding: utf-8
"""
Quick script to dump out the long/lat of most of the capital cities in the world (I removed ones with unicode characters).
"""
import csv
import json
cities = u"""Bulgaria,Sofia,42.40N 023.18E
Czech Republic,Prague,50.06N 014.26E
@drsm79
drsm79 / gist:1223744
Created September 17, 2011 08:04
jsonised cities of the world
{"latitude": "42.40N", "country": "Bulgaria", "longitude": "023.18E", "city": "Sofia"}
{"latitude": "50.06N", "country": "Czech Republic", "longitude": "014.26E", "city": "Prague"}
{"latitude": "15.20N", "country": "Eritrea", "longitude": "038.58E", "city": "Asmera"}
{"latitude": "59.22N", "country": "Estonia", "longitude": "024.48E", "city": "Tallinn"}
{"latitude": "18.08S", "country": "Fiji", "longitude": "178.25E", "city": "Suva"}
{"latitude": "60.08N", "country": "Finland", "longitude": "025.00E", "city": "Helsinki"}
{"latitude": "06.09N", "country": "Iceland", "longitude": "021.51W", "city": "Reykjavik"}
{"latitude": "28.37N", "country": "India", "longitude": "077.13E", "city": "New Delhi"}
{"latitude": "53.20N", "country": "Ireland", "longitude": "006.15W", "city": "Dublin"}
{"latitude": "41.48N", "country": "Italy", "longitude": "012.36E", "city": "Rome"}