Skip to content

Instantly share code, notes, and snippets.

View songcser's full-sized avatar

Henry songcser

  • shanghai
View GitHub Profile
@songcser
songcser / index.html
Created March 1, 2018 06:55
使用websocket和redis搭建聊天室
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
body {padding: 0; margin: 0;}
#chat {
height: calc(100vh - 71px);
@songcser
songcser / 0.Rest API Responses
Last active February 6, 2018 06:13
Rest API Responses
200 OK Success
304 Not Modified There was no new data to return.
400 Bad Request The request was invalid or cannot be otherwise served. An accompanying error message will explain further. Requests without authentication are considered invalid and will yield this response.
401 Unauthorized Missing or incorrect authentication credentials. Also returned in other circumstances (for example, all calls to API v1 endpoints return 401).
403 Forbidden The request is understood, but it has been refused or access is not allowed. An accompanying error message will explain why. This code is used when requests are being denied due to update limits . Other reasons for this status being returned are listed alongside the response codes in the table below.
/var/log/logstash-forwarder.err,
/var/log/logstash-forwarder.log {
size 1M
create 640 root root
rotate 11
missingok
notifempty
sharedscripts
delaycompress
}
python 2.x
title = u'#黄致列 我爱你 #映客 直播 #baidu show #fffff'
p = re.compile(u'#[\w\u4e00-\u9fa5]+\s?')
t = title.encode("utf-8")
tags = p.findall(title)
for tag in tags:
tag = tag.encode("utf-8")
print(tag)
newtag = tag[0:len(tag)-1]+"# "
print(newtag)