Skip to content

Instantly share code, notes, and snippets.

View medcl's full-sized avatar
💭
We build tools, you change world.

Medcl medcl

💭
We build tools, you change world.
View GitHub Profile
@medcl
medcl / gist:758402
Created December 29, 2010 10:28 — forked from kimchy/gist:758398
curl -XPUT 'http://localhost:9200/dbparent/metadata/1' -d '{ "user" : "senthil", "Title" : "trying out Elastic Search"}'
curl -XPUT 'http://localhost:9200/dbparent/metadata/2' -d '{ "user" : "kumar", "Title" : "Elastic Search"}'
curl -XPUT 'http://localhost:9200/dbparent/child/_mapping' -d '{ "child" : { "_parent" : { "type" : "metadata" } }}'
curl -XPUT 'http://localhost:9200/dbparent/child/1?parent=1' -d '{ "tag" : "something"}'
curl -XGET 'http://localhost:9200/dbparent/_search' -d '{
@medcl
medcl / __init__.py
Created January 6, 2012 02:31 — forked from ipconfiger/__init__.py
OAuth包,实现了sina,QQ,网易,搜狐的OAuth认证
# -*- Encoding: utf-8 -*-
import base64
import binascii
import cgi
import hashlib
import hmac
import logging
import time
import urllib
import urlparse
@medcl
medcl / ElasticSearch.org.Website.Search.FieldNotes.markdown
Created January 17, 2012 07:15 — forked from karmi/ElasticSearch.org.Website.Search.FieldNotes.markdown
Field notes gathered during installing and configuring ElasticSearch for http://elasticsearch.org

ElasticSearch.org Website Search: Field Notes

These are field notes gathered during installation of website search facility for the ElasticSearch website.

You may re-use it to put a similar system in place.

The following assumes:

@medcl
medcl / XLSX to ES
Created February 14, 2012 01:46 — forked from stratawing/XLSX to ES
Command Line Script to bulk load XLSX into ES
unzip -Uo 10k_records.xlsx xl/worksheets/sheet1.xml xl/sharedStrings.xml -d proc
cat proc/xl/sharedStrings.xml \
| sed -e 's/[^[:print:][:blank:][:space:]]/[?]/g' -e 's/|/-delim-/g' \
| mawk 'BEGIN {RS = "</t></si><si><t>|<si><t>|</t></si></sst>|</t></si><si><t xml:space=\"preserve\">"
FS = "999ABCDE"
OFS = "|"}
{ print NR - 2, $1 }' \
| LANG=C sort -f -t "|" -k1 \
| grep -v "<sst xmlns=\|<?xml version" \
- Inexplicable perversity of human nature.
- The clever machinations of MongoDB's marketing people.
- The AGPL license killed it.
- We spent too long development before monetizing.
- Bad performance.
- Numeric types limited to a 64-bit `float`.
- Great product, but didn't/couldn't translate to revenue.
- Bad business model.
- Failure in timezones/timestamp nuances.