Skip to content

Instantly share code, notes, and snippets.

View huanglong-zz's full-sized avatar
🎯
Focusing

Scott Dong huanglong-zz

🎯
Focusing
View GitHub Profile
var _IE = (function(){
var v = 3, div = document.createElement('div'), all = div.getElementsByTagName('i');
while (
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
all[0]
);
return v > 4 ? v : false ;
}());
KISSY.add('fixPng', function (S) {
function fixPng(tagCls) {
var arVersion = navigator.appVersion.split('MSIE')
var version = parseFloat(arVersion[1])
if ((version >= 5.5 && version < 7.0) && (document.body.filters)) {
var imgs = KISSY.query(tagCls)
for(var i = 0; i < imgs.length; i++) {
var img = imgs[i]
<?php
$oldtime = time();
$newtime = strtotime(date("Y-m-d H",$oldtime).":00:00");
$seconds = 3600 - $oldtime + $newtime;
$hours = date("H");
echo "<script>var eggSecondsLeft = ".$seconds.", eggHourJust = ".$hours.";</script>";
?>
require 'mina/git'
require 'mina/scp'
# require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
# require 'mina/rvm' # for rvm support. (http://rvm.io)
set :term_mode, nil
set :domain, 'xx.xx.xx.xx'
set :deploy_to, '/www/xx.com'
set :backup_to, '/home/xx/dbbackup'
set :repository, 'git@xx.git'
# /usr/local/etc/nginx/nginx.conf
user nobody;
#worker_processes 2;
error_log /usr/local/etc/nginx/log/nginx/error.log warn;
#pid /usr/local/etc/nginx/run/nginx.pid;
events {
worker_connections 1024;
module.exports = function(grunt) {
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
development: {
options: {
paths: ['public/assets/modules'],
compress: true,
yuicompress: true,
<!DOCTYPE html> <!-- HTML5 doctype 不区分大小写 -->
<html lang="zh-cmn-Hans-CN"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa -->
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <!-- 优先使用IE最新版本和 Chrome -->
<!-- width=device-width 会导致 iPhone 5 添加到主屏后以 WebAPP 全屏模式打开页面时出现黑边 http://bigc.at/ios-webapp-viewport-meta.orz -->
<meta name ="viewport" content ="initial-scale=1.0, maximum-scale=3, minimum-scale=1, user-scalable=no">
var express = require('express') // require is a function realized by nodejs to import and call other function
var routes = require('./routes')
var http = require('http')
var path = require('path')
var fs = require('fs')
var app = express()
app.locals.title = 'Hello World'
app.configure(function(){
官方 http://registry.npmjs.org/
stdyun http://npm.stdyun.com
清华 http://npm.tuna.tsinghua.edu.cn/registry
1. config 命令:
npm config set registry http://npm.stdyun.com
2. 命令行指定:
npm --registry http://npm.stdyun.com info underscore