Skip to content

Instantly share code, notes, and snippets.

View akovski's full-sized avatar

Yu Jia akovski

View GitHub Profile
from __future__ import print_function
import cv2
import weakref
import threading
import numpy as np
import sys
import os
class ImageViewer(object):
'''
@akovski
akovski / .vimrc
Last active June 20, 2018 07:45
my vimrc
set nu
syntax on
syntax enable
set guioptions-=r
set guioptions-=L
set guioptions-=T
set cursorline
"set cursorcolumn
set ruler
filetype indent on
@akovski
akovski / .vimrc
Last active July 24, 2018 06:34
my vimrc
set nu
syntax on
syntax enable
set guioptions-=r
set guioptions-=L
set guioptions-=T
set cursorline
"set cursorcolumn
set ruler
filetype indent on
@akovski
akovski / box.py
Created August 22, 2017 17:08
heihei
def EnumerateBox(rect, boxes):
'''
rect: [[lx, ly], [rx, ry]]
boxes: list of ((lx, ly), (rx, ry))
'''
def generate_allowed(occupied, l, r):
ps = sorted([(x, 0, i) for i, (x, y) in enumerate(occupied)] + [(y, 1, i) for i, (x, y) in enumerate(occupied)])
last_l = l
@akovski
akovski / server.py
Created December 22, 2015 15:51
for receive message from remote client
from flask import Flask, request
app = Flask(__name__)
@app.route('/', methods=['POST', 'GET'])
def steal():
print request.form['test']
return ('', 204)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8000,debug=True)
@akovski
akovski / .vimrc
Last active December 7, 2015 18:21
vimrc
"let g:python_host_prog='/usr/local/bin/python'
let g:python_host_skip_check=1
let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
"colo desert
"colo molokai
"colo xcode-dusk
"colo desert
"colo base16-greenscreen
"colo base16-mocha
"colo dracula
满打满算 口头文学
满打满算 满打满算
不学无术 知名人士
不学无术 小生产者
阿基亚斯 克里特岛
阿基亚斯 克里斯蒂
阿基亚斯 特里斯坦
阿基亚斯 罗切斯特
阿基亚斯 格洛斯特
阿基亚斯 伯恩斯坦
@akovski
akovski / quine.py
Created August 20, 2015 18:18
self print code
a="print 'a=%s%s%s;b=%s%s%s%s;c=%s%s%s%s;%s'%(b,a,b,b,c,b,b,b,c,c,b,a)";b="\"";c="\\";print 'a=%s%s%s;b=%s%s%s%s;c=%s%s%s%s;%s'%(b,a,b,b,c,b,b,b,c,c,b,a)