Skip to content

Instantly share code, notes, and snippets.

@is
is / sublime.setting
Created January 5, 2016 13:52
sublime.setting
{
"color_scheme": "Packages/Materialize/schemes/Material Flatland.tmTheme",
"font_face": "Luculent 14",
"font_options":
[
"antialias",
"gray_antialias"
],
"font_size": 14,
"ignored_packages":
@is
is / Z1.java
Last active October 16, 2015 03:57
Z1.java
package s0;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
public class Z1 {
public static final int level = 18;
@is
is / GCJ-02.js
Last active October 4, 2015 08:14
GCJ-02
//World Geodetic System ==> Mars Geodetic System
//translate from https://on4wp7.codeplex.com/SourceControl/changeset/view/21483#353936
var WGS84_to_GCJ02 = function() {}
WGS84_to_GCJ02.prototype.a = 6378245.0;
WGS84_to_GCJ02.prototype.ee = 0.00669342162296594323;
WGS84_to_GCJ02.prototype.transform = function(wgLat, wgLon) {
if (this.outOfChina(wgLat, wgLon)) {
return [wgLat, wgLon];
@is
is / Aes.java
Created February 22, 2015 17:38
PBKDF2 Python & Java
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
// Reference
// Keyword: PBKDF2WithHmacSHA1 PBKDF2WithHmacSHA512
@is
is / s0.py
Created February 16, 2015 16:13
Shapely & Fiona sample code.
import fiona
from shapely.geometry import shape
from shapely.geometry import Polygon
from shapely.geometry import geo
p0 = geo.box(116, 22, 117, 23)
def main():
shapes = []
fa = fiona.open('c1/continent.shp')
n = 0
@is
is / ivysetting.xml
Created October 16, 2014 15:48
chinese ivysetting
<ivysettings>
<settings defaultResolver="chain"/>
<resolvers>
<chain name="chain">
<ibiblio name="maven-cn" m2compatible="true" root="http://maven.net.cn/content/groups/public/"/>
<ibiblio name="oschina" m2compatible="true" root="http://maven.oschina.net/content/groups/public/"/>
<ibiblio name="central" m2compatible="true"/>
</chain>
</resolvers>
</ivysettings>
@is
is / upgrade.txt
Created November 29, 2013 17:12
tiantianaixiyou
S2 = S1 + X
S3 = S2 + XX
S4 = S3 + S3 + X = S3 + S3 + X = 2S3 + X
S5 = S4 + S3 + XX = S4 + S3 + 3X = 3S3 + 3X
S6 = S5 + S4 + XXXX = S5 + 3S3 + 7X = 6S3 + 10X
S7 = S6 + S5 + XXXX = S6 + 3S3 + 7X = 9S3 + 17X
@is
is / sbt-credentials.md
Created November 13, 2013 17:39
SBT_CREDENTIALS

简单的说两句.

大家用自己的repo源,{{SBT}} 配置比较简单, {{$HOME/.sbt}} 下面建立一个repositories的文件就好了 网上例子很多

[repositories]
  local
 my-ivy-proxy-releases: http://repo.mycompany.com/artifactory/release/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
#!/usr/bin/python
import sys, os, os.path
GITHUB_SRC_ROOT='/is/github'
# git@github.com:is/conf.git
# https://github.com/is/conf.git
def ParseURL(url):
curl -XPUT http://localhost:9200/_template/logstash_index_template -d '
{
"template": "logstash-*",
"mappings": {
"_default_": {
"_all": {"enabled": false},
"dynamic_templates": [{
"string_template" : {
"match" : "*",
"mapping": { "type": "string", "index": "not_analyzed" },