Skip to content

Instantly share code, notes, and snippets.

@echo off
set "pwd=%cd%"
cd ../../..
SETLOCAL enabledelayedexpansion
for /r %pwd% %%i in (*.proto) do (
set "str=%%i"
set "str2=!str:%cd%\=!"
@z-lite
z-lite / file
Last active November 28, 2016 05:38
freedom_public
{"0.9229514588818877":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgME+VxvyamvY5Lmpqv/qYD3sX34CVFXT/EX\r\nZ9UWaoEu9OxVE2sINM86KHzTYs4DXp2o/ngxuaZ3hg2ntTAR4/sXH83/AAAACDxn\r\naXRodWI+wv8AAACOBBATCABA/wAAAAWCWDvBWP8AAAACiwn/AAAACZAm+CikiIbM\r\nEf8AAAAFlQgJCgv/AAAABJYDAQL/AAAAApsD/wAAAAKeAQAA0r0A/iPNGFoL9w80\r\nsefSCOSMaD3kbHbCCBLT3nxzqrw78H1FAQCctezolKqrd23cPfo4VsOLs7FvXfbx\r\nZA595MZlv8Ke3s7/AAAAVgQAAAAAEggqhkjOPQMBBwIDBJ6NF7/rWX3SJcWd6Wrm\r\nAlCMwoc2TL2WpPrc3Ytu83SeYEPqrGcmbU+t7oimDUm041uEtLn6nO85a/GgzA0D\r\nXEwDAQgHwv8AAABtBBgTCAAf/wAAAAWCWDvBWP8AAAAJkCb4KKSIhswR/wAAAAKb\r\nDAAAaUkA/AttqagbTI0/RtiDJ9mwoehY7mGNfSt50GOAloll6ZUXAQCdjL523sGC\r\noqwQdBqURzbSgD9+1ubpY/PQtILOh9cjCQ==\r\n=eOfM\r\n-----END PGP PUBLIC KEY BLOCK-----\r\n","0.6463818907487795":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgME+VxvyamvY5Lmpqv/qYD3sX34CVFXT/EX\r\nZ9UWaoEu9OxVE2sINM86KHzTYs4DXp2o/ngxuaZ3hg2ntTAR4/sXH83/AAAACDxn\r\naXRodWI+wv8AAACOBB
@z-lite
z-lite / tornado_asyncio.py
Created April 20, 2016 03:53 — forked from drgarcia1986/tornado_asyncio.py
Tornado and Asyncio Mixed example
# -*- coding: utf-8 -*-
import asyncio
import re
import asyncio_redis
import tornado.concurrent
import tornado.httpclient
import tornado.web
import tornado.platform.asyncio
@z-lite
z-lite / docker-gnatsd-cluster.org
Created October 12, 2015 09:30 — forked from wallyqs/docker-gnatsd-cluster.org
Docker GNATSD Cluster example

Docker GNATSD Cluster example

Below is an example of how to setup gnatsd cluster using Docker.

I have put 3 different configurations (one per gnatsd server) under a folder named conf as follows:

tree conf
@z-lite
z-lite / cloud-config-master-node.yaml
Last active September 16, 2015 11:49 — forked from noonien/cloud-config-master-node.yaml
k8s v0.15.0 on CoreOS
#cloud-config
hostname: node-01
ssh_authorized_keys:
- ssh-rsa <redacted>
coreos:
etcd2:
discovery: https://discovery.etcd.io/<redacted>
advertise-client-urls: http://node-01.mux.lan:2379
# use with: logging.config.dictConfig(yaml.load(open('logging.yaml', 'r')))
# Formatters detailed here: http://docs.python.org/2/library/logging.html#logrecord-attributes
version: 1
formatters:
simple:
format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
detail:
format: '%(asctime)s - %(levelname)s - File: %(filename)s - %(funcName)s() - Line: %(lineno)d - %(message)s'
'''
This is a module that defines some helper classes and functions for
expiring groups of related keys at the same time.
Written July 1-2, 2013 by Josiah Carlson
Released into the public domain
'''
import time
@z-lite
z-lite / gps.js
Last active November 10, 2015 16:18
坐标转换
var GPS = {
PI: 3.14159265358979324,
x_pi: 3.14159265358979324 * 3000.0 / 180.0,
delta: function (lat, lon) {
// Krasovsky 1940
//
// a = 6378245.0, 1/f = 298.3
// b = a * (1 - f)
// ee = (a^2 - b^2) / a^2;
var a = 6378245.0; // a: 卫星椭球坐标投影到平面地图坐标系的投影因子。
from concurrent.futures import ThreadPoolExecutor
from functools import partial, wraps
import time
import tornado.ioloop
import tornado.web
EXECUTOR = ThreadPoolExecutor(max_workers=4)

Ruby in 100 Minutes

About Ruby

Ruby was written to make the programmer's job easy and not care if the computer's job is hard. In this brief introduction we'll look at the key language features you need to get started.

Key Language features

  1. Instructions and Interpreters