Skip to content

Instantly share code, notes, and snippets.

//http://www.it165.net/os/html/201308/5868.html
#include <sys/socket.h>
#include <sys/wait.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <sys/epoll.h>
#include <sys/sendfile.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
@luw2007
luw2007 / tag
Created August 6, 2018 10:47
自动为git项目打版本号。保存为/usr/loca/bin/tag,chmod +x /usr/loca/bin/tag。 在git目录执行tag 即可
#!/bin/sh
# 版本号类似于 MAJOR.MINOR.PATCH 遵循 Semantic Versioning 2.0.0:
# MAJOR: 主版本号,不兼容的修改,如:底层重构、框架层变动
# MINOR:次版本号,向前兼容的修改,如:增加新功能、代码优化
# PATCH: 小版本号,修复bug
PREFIX=v
DEFAULT_VERSION=0.0.0
# 获取git版本号
0xA62D03dA4F56043663859c9173E8E6ad9A24C40a
@luw2007
luw2007 / coding_net_html5.md
Last active June 22, 2017 13:43
coding.net html5大赛中推荐的开发者服务简介

coding.net html5大赛中推荐的开发者服务简介

按照[页面][event-html5]序,内容来自各家about 或首页, 有所缩减. 厂商勿闹

##存储: ###七牛 [七牛][qiniu]云存储由国内存储行业的领军人物之一许式伟于2011年创立,致力于提供最适合开发者的数据在线托管、传输加速以及云端处理的服务。

七牛云存储的核心团队成员来自于盛大、金山、网龙、惠普等知名互联网公司。核心成员之间已合作多年。公司创始人许式伟先生曾在金山、百度和盛大等公司担任重要领导岗位,具有多年存储行业实战经验,被誉为国内最适合做云存储的几人之一。

@luw2007
luw2007 / pyuno_in_ubuntu_14.md
Created January 16, 2015 09:07
Python 2.7 with pyuno in ubuntu

##ubuntu 13.10 and later , you need to install openoffice 4.1.1

###1. uninstall libreoffice and openoffice

sudo apt-get remove libreoffice* openoffice*
sudo apt-get autoremove

###2. install Apache OpenOffice 4.1.1 on 64 bit Ubuntu

wget sourceforge.net/projects/openofficeorg.mirror/files/4.1.1/binaries/en-GB/Apache_OpenOffice_4.1.1_Linux_x86-64_install-deb_en-GB.tar.gz

@luw2007
luw2007 / matplotlib_ttc.md
Last active December 30, 2015 23:59
matplotlib 支持 ttc . 原理为修改matplotlib 的 字体查找函数, 让其可以查找ttc 字体.

#matplotlib 支持 ttc ttc 是 microsoft 的标准, 还是建议使用 ttctools 分解 ttc 为多个ttf . 然后拷贝ttf 到字体目录(/usr/share/fonts/truetype)

grep Wen ~/.cache/matplotlib/fontList.cache
S'WenQuanYi Micro Hei'

以下为hack方法, 不建议使用

matplotlib 1.3.1 版本中默认不使用ttc 字体, hack matplotlib的字体查找方法, 使其可以使用ttc 字体. ##安装字体

diff --git a/pprint.py b/pprint.py
--- a/pprint.py
+++ b/pprint.py
@@ -36,6 +36,7 @@ saferepr()
import sys as _sys
import warnings
+import locale
from cStringIO import StringIO as _StringIO
@luw2007
luw2007 / ds_796
Created October 10, 2013 08:19
ds_796 连
2013-10-10 15:24:21,461 - 282: 得到 一张3星卡 特异型黑沃尔
2013-10-10 15:24:36,321 - 282: 得到 一张3星卡 特异型圣日耳曼
2013-10-10 15:24:36,872 - 282: 得到 一张4星卡 第二型加雷斯
2013-10-10 15:24:37,459 - 282: 得到 一张4星卡 支援型甜心
2013-10-10 15:24:38,042 - 282: 得到 一张4星卡 特异型猎户座
2013-10-10 15:24:38,632 - 282: 得到 一张3星卡 特异型白雪公主
2013-10-10 15:24:39,207 - 282: 得到 一张4星卡 支援型提妮亚
2013-10-10 15:24:39,832 - 282: 得到 一张4星卡 复原型乌瑟
2013-10-10 15:24:40,420 - 282: 得到 一张5星卡 幻兽型月兔
2013-10-10 15:24:41,039 - 282: 得到 一张3星卡 支援型兰克
@luw2007
luw2007 / requiretment.md
Created September 16, 2013 08:03
requiretment.md

#需求分析

##探索

  • 自动探索,每日密境 > 活动密境 > 固定密境
  • 计算升级时间

##妖精战

  • 舔妖
  • 计算是否秒掉
  • 吃BC 秒觉醒
@luw2007
luw2007 / sdo_cname
Last active December 23, 2015 03:59
sdo_cname
178.sdo.com
ac.sdo.com
act.mxd.sdo.com
adrs.sdo.com
aion.sdo.com
analytics.sdo.com
bbs.gui.sdo.com
bbs.sdch.sdo.com
bnb.sdo.com
cal.sdo.com