This file contains hidden or 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
| __author__ = 'feng' | |
| articles = [ | |
| 'Familiarize Yourself with IntelliJ IDEA editor', | |
| 'While keeping the Ctrl key pressed, rotate the mouse wheel. As you rotate the mouse wheel forward', | |
| 'font size grows larger; as you rotate the mouse wheel backwards, font size decreases', | |
| 'In the popup frame, type Reset font size, and click Enter.', | |
| 'These operations apply to the active editor only. In the other editor tabs, font size is not affected.', | |
| 'There is no default keyboard shortcut associated with Reset font size action. However, you can create your', | |
| 'Place the caret in the editor.' |
This file contains hidden or 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 time | |
| from datetime import datetime, date | |
| # 今天 | |
| datetime.datetime.today().date().isoformat() | |
| # 通过日期对象生成时间戳 | |
| int(time.mktime(datetime.now().timetuple())) | |
| # 通过时间戳生成日期对象,timestamp 的时间戳以秒为单位 |
This file contains hidden or 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
| <?php | |
| /* | |
| OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP) | |
| Author: _ck_ (with contributions by GK, stasilok) | |
| Version: 0.1.7 | |
| Free for any kind of use or modification, I am not responsible for anything, please share your improvements | |
| * revision history | |
| 0.1.7 2015-09-01 regex fix for PHP7 phpinfo | |
| 0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter |
This file contains hidden or 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
| #! /usr/bin/env python2.7 | |
| #encoding:utf-8 | |
| #@description:一个python守护进程的例子 | |
| #@tags:python,daemon | |
| import sys | |
| import os | |
| import time | |
| import atexit | |
| from signal import SIGTERM |
This file contains hidden or 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
| 表格受密码保护时,我们修改数据Excel弹出“您试图更改的单元格或图表受保护,因而是只读的。 | |
| 若要修改受保护单元格或图表,请先使用‘撤消工作表保护’命令(在‘审阅’选项卡的‘更改’组中)来取消保护。 | |
| 可能会提示输入密码。这时候我们可以用VBA宏代码破解法来破解表格保护密码: | |
| 第一步:打开该文件,先解除默认的“宏禁用”状态,方法是点击工具栏下的“选项”状态按钮, | |
| 打开“Microsoft Office安全选项”窗口,选择其中的“启用此内容”,“确定” | |
| 再切换到“视图”选项卡,点击“宏”→“录制宏”,出现“录制新宏”窗口,在“宏名”定义一个名称为: | |
| PasswordBreaker,点击“确定”退出; | |
| 第二步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“编辑”, | |
| 打开“Microsoft Visual Basic”编辑器,用如下内容替换右侧窗口中的所有代码: |
This file contains hidden or 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
| <?php | |
| // 一个一致性hash实现 http://github.com/pda/flexihash | |
| require '/path/to/flexihash/include/init.php'; | |
| require '/path/to/lysine/loader.php'; | |
| // user和topic数据垂直切分 | |
| // user数据放在mysql数据库 | |
| // topic数据放在postgresql数据库 | |
| // topic数据水平切分,分区到3台服务器上 | |
| $config = array( |
This file contains hidden or 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
| # 指定Nginx工作的用户和用户组,www-data 是我们新建的一个虚拟用户 | |
| user www-data www-data; | |
| # 指定Nginx工作的进程数,默认是1。建议参考CPU内核数,双核处理器又是超线程的话可以设置为4个,避免进程堵塞在IO等待中。 | |
| worker_processes 4; | |
| events { | |
| use epoll; # 指定I/O模式,epoll是Linux内核2.6(或以上)中一种比较高效的异步IO模型 | |
| worker_connections 8000; # 规定单个进程可以处理的请求数 | |
This file contains hidden or 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
| #!/bin/sh | |
| # | |
| # redis - this script starts and stops the redis-server daemon | |
| # | |
| # chkconfig: - 85 15 | |
| # description: Redis is a persistent key-value database | |
| # processname: redis-server | |
| # config: /etc/redis/redis.conf | |
| # config: /etc/sysconfig/redis | |
| # pidfile: /var/run/redis.pid |
NewerOlder