Skip to content

Instantly share code, notes, and snippets.

三月沙 zhyq0826

Block or report user

Report or block zhyq0826

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
zhyq0826 / gist:27ed09fd419b78bfcfba
Created Oct 31, 2015 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts
View gist:27ed09fd419b78bfcfba

Sublime Text 2 – Useful Shortcuts (Mac OS X)


⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
zhyq0826 / Future_illustrate
Last active Aug 29, 2015 — forked from davidbirdsong/Future_illustrate
use ioloop.IOLoop.instance().add_future to create a callback for a completed Future object
View Future_illustrate
from concurrent.futures import ThreadPoolExecutor
from tornado.concurrent import run_on_executor, Future
from tornado import httpclient,ioloop,web,gen
import request
import sys
httpclient.AsyncHTTPClient.configure('tornado.curl_httpclient.CurlAsyncHTTPClient', max_clients=10)
# TODO: remove
class Foo(Exception): pass
def dot():
zhyq0826 /
Last active Aug 29, 2015 — forked from lbolla/
Tornado and concurrent.futures
from concurrent.futures import ThreadPoolExecutor
from functools import partial, wraps
import time
import tornado.ioloop
import tornado.web
EXECUTOR = ThreadPoolExecutor(max_workers=4)
View gist:b2a43514cfd76d433078
from datetime import datetime
def format_show_time(v, start=None, end=None):
diff = - v
if diff.seconds < 60:
s = ('%s%s') % (diff.seconds, '秒前')
elif diff.seconds >= 60 and diff.seconds < 3600:
s = ('%s%s') % (diff.seconds / 60, '分钟前')
elif diff.seconds >= 3600 and (v > start and v < end):
s = ('%s%s') % ('今天', datetime.strftime(v, format='%H:%M'))
zhyq0826 /
Last active Sep 4, 2016
python 移除list 中的某个元素
import random
def slice_remove(s, item):
start = s.index(item)
length = s.count(item)
a = s[0:start]
b = s[start+length:]


@版本 2.0.0

譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.

此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。

Rebecca MurpheyBaseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。

View flippant demo
<link href="" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="flippant.css">
<style type="text/css">
.container { margin-top: 2em; }
h1 span {
animation: flipper 3s ease-in 4s infinite;
zhyq0826 /
Last active May 31, 2019
python 根据根据日期计算所在周的开始和结束
import datetime
def get_week():
today =
month = today.month
year = today.year
day =
weekday = today.weekday()
start = today + datetime.timedelta(0-weekday)
You can’t perform that action at this time.