Faster responses with fastcgi_finish_request (PHP-FPM)

利用fastcgi_finish_request加快页面响应

fastcgi_finish_request() flushes all response data to the client and ends the request. The worker can keep running heavy work after the connection closes.

With PHP-FPM this is a simple “respond first, finish later” pattern. Notes mostly followed Huoding’s post (2011, concept still applies).

Read More

Share   |  Updated:

hexo同步托管到gitcafe和github

update :国内page不稳定,已放弃!!!

update : coding.net现在已替换为腾讯云托管 操作应该类似, page若有问题可重建项目生成

update : gitcafe已关闭,现在已替换为coding.net 操作类似

Hexo是node.js生成的静态博客,托管到gitcafe或者github的page服务就可以变成自己免费的博客,当然最重要的是写博客更方便了。
有了github,为什么还要用gitcafe。因为国内的百度抓取太不给力,只好用gitcafe来配合。。。

本文主要说一下gitcafe的配置

coding.net gitcafe

注册

coding.net注册邀请

创建page项目

怎么做?直接上 官方wiki

Read More

Share   |  Updated:

dropbox同步你的mac文件

翻墙可用Dropbox同步

免费管理可选:git@OSC,有免费设置公有私有仓库,git管理,还不错!

如果非要同步,试试坚果云

相信弄Hexo博客的同仁们,费劲弄好的博客文章是不愿意出差错丢失、误删的。
于是,dropbox的自动同步就派上用场。

Read More

Share   |  Updated:

mac vim高亮及缩进设置

看着默认的vim显示效果不爽,查了下设置,搞起。

将vim的环境文件copy到自己常用用户的主目录下

cp /usr/share/vim/vimrc ~/.vimrc

修改.vimrc文件归读写属性

sudo chmod o+w .vimrc

语法高亮

用vim等打开.vimrc在文件最后加上

syntax on

Read More

Share   |  Updated:

MySQL — LIMIT inside IN/ALL/ANY/SOME subqueries

解决mysql不可用limit子查询

Put LIMIT in a subquery that sits under IN, ALL, ANY, or SOME, and MySQL hits you with:

ERROR 1235 (42000): This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery’

LIMIT is already a weak spot in MySQL, so the server blocks this combination. You still need the result set sometimes.

Example rules:

  • 5 first-prize winners
  • 15 second-prize winners
  • Anyone who won first prize cannot win second

You might write something like:

Read More

Merging batched data in JS — reduce accumulator vs concat

JS 合并批量数据:reduce 累加 vs concat(别再误用 reduce)

Background: scraping school records via JSONP in the browser console. The lesson is not the site — it is that reduce is not always the right merge tool when your batches are not plain arrays.

Read More

Share   |  Updated:

redis安装

centos下安装redis


# 解压(当前版本:3.0.5)
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
make install
  • 设为服务项自启动

Read More

Share   |  Updated: