HTTP 请求 | 优点 | 缺点 | 得分 |
---|---|---|---|
GET /create/user?username={username} | 不需要思考 | 罄竹难书 | 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
import logging | |
import time | |
def log_func( | |
logger: logging.Logger, | |
*, | |
log_input=True, | |
input_level=logging.WARNING, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"longitude" : 116.383, | |
"city_name_en" : "Beijing", | |
"province_url" : "/wiki/Beijing", | |
"full_name_en" : "Beijing:Beijing", | |
"city_url" : "/wiki/Beijing", | |
"province_name_en" : "Beijing", | |
"latitude" : 39.917, | |
"city_name_cn" : "北京市" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"math/rand" | |
"sort" | |
"time" | |
) | |
func merge(xs, ys []int) []int { | |
sizex, sizey := len(xs), len(ys) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1 domain per line | |
# *ALL* domains use the same ssl certificate | |
my.domain1.com | |
my.domain2.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package version | |
import ( | |
"strconv" | |
"strings" | |
) | |
type Version struct { | |
Major int | |
Minor int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PaginationMixin(object): | |
def paginate(self, order_by=None, order_dir=None, limit=None, cursor=None, page=None): | |
assert not page or not cursor, 'should not combine cusor and page' | |
# convert arguments | |
if isinstance(order_by, str): | |
order_by = getattr(self._primary_entity.expr._identity_class, order_by) | |
# check arguments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bookmarklet | |
// | |
// javascript:function listFoods(beginStr, endDateStr, foodBlacklist) { var _es = document.querySelectorAll('.Message-wrapper'); var es = Array.slice.call(0, _es); es.reverse(); var counts = {}; for (var e of es) { var author = e.querySelector('.author'); var message = ''; for (var sube of e.querySelectorAll('.Message-body')) { message += sube.innerText; } message = message.trim(); if (message.match(beginStr)) { break; } if (!foodBlacklist.includes(message)) { counts[message] = counts[message] || []; counts[message].push(author && author.innerText.trim()); } var ended = false; for (var b of e.querySelectorAll('.Message-body')) { var date = e.querySelector('.Messages-date'); if (date && date.innerText.trim() === endDateStr) { ended = true; } } if (ended) { break; } } var strs = []; for (var k of Object.keys(counts)) { var str = k + '(' + counts[k].length + '份): ' + counts[k].join(', '); strs.push(str); } return strs;}var foods = listFoods('大家订餐了', '今天', ['@讨论组']);alert(foods.join('\n'));for ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
location / { | |
default_type application/json; | |
return 400 '{"data": {}, "meta": {"error_message": "系统维护中,预计5点完成", "success": false}}'; | |
} | |
location /api { | |
default_type 'text/html'; | |
return 200 '<center style="padding: 16em 0; color: #333;"><h1>系统维护中</h1><p>系统正在进行停机维护,预计8月23日凌晨5点完成。</p></center>'; | |
} |
NewerOlder