Skip to content

Instantly share code, notes, and snippets.

View libo1106's full-sized avatar

libo libo1106

View GitHub Profile
@squallstar
squallstar / Gruntfile.js
Last active January 10, 2016 11:10
Retina images with Grunt
//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': {
@fddxyz
fddxyz / duoshuo
Created September 23, 2012 08:25
duoshuo sso auth class
<?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 ="";
@sofish
sofish / first.js
Created August 31, 2012 05:47
面试的时候我会经常问,js 中如何获得 <ul> 下的第一个 <li>,你的答案是什么?
// 大家写在评论中吧,代码高亮可以这样写:
// ```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 = {};
@cjoudrey
cjoudrey / twitter.js
Created November 5, 2011 16:37
Lazy-rendering in PhantomJS
// 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)
@why404
why404 / nginx_conf_with_annotation.conf
Created December 29, 2009 15:26
Nginx配置说明
# 指定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; # 规定单个进程可以处理的请求数