Skip to content

Instantly share code, notes, and snippets.

View aisk's full-sized avatar
🍺
Drunk

AN Long aisk

🍺
Drunk
View GitHub Profile
@aisk
aisk / gist:3735854
Created September 17, 2012 06:37
百度地图坐标与像素互相转换的方法
pixelToPoint = function(point, zoom, center, bounds) {
// 像素到坐标
if (!point) {
return
}
var zoomUnits = getZoomUnits(zoom);
var mercatorLng = center.lng + zoomUnits * (point.x - bounds.width / 2);
var mercatorLat = center.lat - zoomUnits * (point.y - bounds.height / 2);
var mercatorLngLat = {lng: mercatorLng, lat: mercatorLat};
return mercatorToLngLat(mercatorLngLat)
@aisk
aisk / manual.go
Created April 26, 2020 16:57
go dispatch bench
package main
import (
"fmt"
"strconv"
"unsafe"
)
const (
typeInt = iota
@aisk
aisk / container.bsk
Last active June 22, 2019 04:56
berserker lang hello world example
using std;
using assert;
func main = ()=> int {
list<int> l = [0, 1, 2, 3, 4, 5];
dict<char*, int> d = {
"one": 1,
"two": 2,
"tree": 3,
};
package main
import (
"net/http"
"net/http/pprof"
"github.com/aisk/vox"
)
func main() {
04db446f5fe1dfd66b4f17e2063484ed4b33e22c3a71c49dc667143e8d26766dfdee8531eef317599b56e5ff48a584b6d2dfdd7887fb3c2980b18b3206aa2f1c91 feisuzhu
import dis, marshal, struct, sys, time, types
def show_file(fname):
f = open(fname, "rb")
magic = f.read(4)
moddate = f.read(4)
modtime = time.asctime(time.localtime(struct.unpack('L', moddate)[0]))
print "magic %s" % (magic.encode('hex'))
print "moddate %s (%s)" % (moddate.encode('hex'), modtime)
code = marshal.load(f)
extern crate bytes;
extern crate futures;
extern crate tokio_io;
extern crate tokio_proto;
extern crate tokio_service;
use std::io;
use std::str;
use bytes::BytesMut;
use futures::{future, Future};
package main
import (
"fmt"
"time"
"github.com/aisk/vox"
)
func timeit(ctx *vox.Context, next func()) {
import sys
import time
import asyncio
import websockets
from datetime import datetime
last_connect_time = datetime.now()
@asyncio.coroutine
#! /usr/bin/env python2.7
import os
import subprocess
import sys
import tempfile
def is_skipped_folder(cpython_repo, path):
skipped_folders = [