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
//Grunt Spritesmith plugin | |
sprite: { | |
build: { | |
src: ['src/img/sprite/*.png'], | |
destImg: 'build/img/s-' + timestamp + '.png', | |
destCSS: 'src/scss/common/sprite.scss', | |
imgPath: '../img/s-' + timestamp + '.png', | |
algorithm: 'binary-tree', | |
engine: 'gm', | |
'engineOpts': { |
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
<?php | |
//more info at:http://dev.duoshuo.com/threads/5023323ce9b7bde608000012 | |
class duoshuo extends CI_Controller | |
{ | |
public $short_name=""; | |
public $secret =""; | |
public $remote_auth =""; | |
public $access_token =""; |
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
// 大家写在评论中吧,代码高亮可以这样写: | |
// ```js | |
// your code | |
// ``` | |
// update: Fri Aug 31 08:39:21 | |
// copyright: https://gist.github.com/3549352 | |
// 加个性能测试:http://jsperf.com/get-dom-s-first-element | |
var util = {}; |
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
// This example shows how to render pages that perform AJAX calls | |
// upon page load. | |
// | |
// Instead of waiting a fixed amount of time before doing the render, | |
// we are keeping track of every resource that is loaded. | |
// | |
// Once all resources are loaded, we wait a small amount of time | |
// (resourceWait) in case these resources load other resources. | |
// | |
// The page is rendered after a maximum amount of time (maxRenderTime) |
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
# 指定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; # 规定单个进程可以处理的请求数 | |