Skip to content

Instantly share code, notes, and snippets.

upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name www.example.com;
rewrite ^ http://example.com$request_uri?;
}
<!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">
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@cycyewt
cycyewt / scroll
Created September 26, 2013 02:03
$(function() {
var speed = -1,
banner = document.getElementById('banner'),
main1 = document.getElementById('main1'),
wrap1 = document.getElementById('wrap1'),
wrap2 = document.getElementById('wrap2'),
timer,
interval = 15,
left;
@cycyewt
cycyewt / uri.js
Created September 15, 2013 12:49 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@cycyewt
cycyewt / gist:6561725
Created September 14, 2013 12:42
font-family
font-family: Helvetica, Tahoma, Arial, STXihei, "华文细黑", Heiti, "黑体", "Microsoft YaHei", "微软雅黑", SimSun, "宋体", sans-serif;
@cycyewt
cycyewt / tgrid
Created August 29, 2013 12:44
t grid
<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<title>grid</title>
<link rel="stylesheet" href="./assets/css/ju-base.css">
<style type="text/css" media="screen">
.t-grid {
margin: 10px auto;
width: 1000px;
[
{
name:"HTML5",
uri:"http://www.w3.org/TR/html5/single-page.html",
category:"markup"
},
{
name:"HTML 5.1",
uri:"http://www.w3.org/TR/html51/single-page.html",
category:"markup"
@cycyewt
cycyewt / iOSWebAppMisc
Created June 24, 2013 08:53
ios web app misc
<!-- iOS Device Startup Images -->
<!-- iPhone/iPod Touch Portrait – 320 x 460 (standard resolution) -->
<link rel="apple-touch-startup-image" href="images/ios/iphone-startup-320-460.png" media="screen and (max-device-width: 320px) and (-webkit-min-device-pixel-ratio: 1)" />
<!-- iPhone/iPod Touch (high-resolution) Portrait – 640 x 920 pixels -->
<link rel="apple-touch-startup-image" href="images/ios/iphone-startup-640-920.png" media="screen and (max-device-width: 320px) and (-webkit-min-device-pixel-ratio: 2)" />
<!-- iPad Landscape 1024x748 -->
<link rel="apple-touch-startup-image" sizes="1024x748" href="images/ios/ipad-startup-1024-748.png" media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape) and (-webkit-min-device-pixel-ratio: 1)" />
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="yes" name="apple-mobile-web-app-capable">
<title>iOS Web App</title>
<!-- iPhone -->