Skip to content

Instantly share code, notes, and snippets.

@designershao
designershao / TSDQueryMain.java
Last active Mar 7, 2019
OpenTSDB Limit Query
View TSDQueryMain.java
import com.google.common.base.Strings;
import com.stumbleupon.async.Callback;
import com.stumbleupon.async.Deferred;
import net.opentsdb.core.*;
import net.opentsdb.utils.Config;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
@designershao
designershao / app.py
Last active Nov 1, 2019
生成 odoo 省市县数据
View app.py
import json
import xml.etree.ElementTree as ET
from xml.dom import minidom
import os
from pypinyin import Style, pinyin
from functools import reduce
dir_path = os.path.dirname(os.path.realpath(__file__))
print(ET.ElementTree)
@designershao
designershao / gist:7192220
Created Oct 28, 2013
Get the location through baidu map`s api in ruby.
View gist:7192220
require 'net/http'
require 'json'
url = "http://api.map.baidu.com/geocoder?address=address_you_find&output=json&key=you_secret_key&city=city_you_find"
uri = URI.escape(url)
json_str = Net::HTTP.get(URI(uri))
value = JSON.parse(json_str)
puts value["result"]["location"]