Skip to content

Instantly share code, notes, and snippets.

View onriv's full-sized avatar
🎯
Focusing

onriv onriv

🎯
Focusing
View GitHub Profile
We couldn’t find that file to show.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\igvita-desert]
"Present"=dword:00000001
"LogFileName"="putty.log"
"LogType"=dword:00000000
"LogFileClash"=dword:ffffffff
"LogFlush"=dword:00000001
"SSHLogOmitPasswords"=dword:00000001
"SSHLogOmitData"=dword:00000000
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\monokai]
"Colour21"="255,255,255"
"Colour20"="245,222,179"
"Colour19"="200,240,240"
"Colour18"="0,217,217"
"Colour17"="179,146,239"
"Colour16"="174,129,255"
"Colour15"="122,204,218"

呼伦贝尔骑行计划书

出行时间

2013.6.9 ~ 6.16 (端午+请两天假+周末)

计划安排 16 日到达北京,不影响 17 日正常上班。

总公里数

@onriv
onriv / OLS_20.py
Created March 21, 2014 14:26
math:KroneckerProduct
# OLS_4 = [[(0, 0), (2, 2), (3, 3), (1, 1)],
# [(2, 3), (0, 1), (1, 0), (3, 2)],
# [(3, 1), (1, 3), (0, 2), (2, 0)],
# [(1, 2), (3, 0), (2, 1), (0, 3)]]
# OLS_5 = [[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)],
# [(1, 2), (2, 3), (3, 4), (4, 0), (0, 1)],
# [(2, 4), (3, 0), (4, 1), (0, 2), (1, 3)],
# [(3, 1), (4, 2), (0, 3), (1, 4), (2, 0)],
# [(4, 3), (0, 4), (1, 0), (2, 1), (3, 2)]]
@onriv
onriv / mkdir.py
Created March 16, 2014 10:54
python:mkdir:mkdir.py
# -*- coding: utf-8 -*-
def mkdir(path, relative = True):
import os
currentPath = os.getcwd().replace("\\",'/')
path = path.strip()
path = currentPath + '/' + path.replace("\\",'/').rstrip('/')
if not os.path.exists(path):
print 'The Directory ' + path + ' has been created.'
os.makedirs(path)
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@onriv
onriv / tuplesGen.py
Created March 6, 2014 17:48
python;生成所有元组;多重循环节简化;tuplesGen.py
# -*- coding: utf-8 -*-
"""
根据给定的范围,用混合进制的方式输出所有元组。
"""
def tuplesGen(ranges):
"""
>>> ranges = (2,3,4)
>>> for t in tuplesGen(ranges):
@onriv
onriv / util.py
Last active January 2, 2016 14:29
python:textconvert:util.py
"""
handle text in an open file
lines: yield every line in the open file;
blocks: yield every block ine open file. A block is many lines containing no empty lines.
"""
def lines(file):
for line in file: yield line
# yield '\n'
@onriv
onriv / handlers.py
Created January 8, 2014 13:31
pyhton:textconvert:handlers.py
class Handler:
"""
An object that handles method calls from the Parser.
The Parser will call the start() and end() methods at the
beginning of each block, with the proper block name as a
parameter. The sub() method will be used in regular expression
substitution. When called with a name such as 'emphasis', it will
return a proper substitution function.
"""