Skip to content

Instantly share code, notes, and snippets.

View GZShi's full-sized avatar
🎯
Focusing

Guozhong Shi GZShi

🎯
Focusing
View GitHub Profile
@GZShi
GZShi / index.html
Last active August 29, 2015 14:06
Sort Animation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sort Animation</title>
<script src="sort_animation.js"></script>
</head>
<body>
<style>
body {
@GZShi
GZShi / type.js
Created October 28, 2014 09:06
简单的类型检测
/**
* 类型检测
*
* @param obj {} 待检测的对象
* @return {object}
*/
function type(obj) {
return {
'type': Object.prototype.toString.call(obj).substr(8).split(']')[0],
'toString': function () { return this.type; },
@GZShi
GZShi / 11.11.js
Last active August 29, 2015 14:09
定时秒杀
/**
* 1. 更改日期和时间设置
* 2. Internet 时钟
* 3. 更改设置
* 4. time.pool.aliyun.com
* 5. 立即更新
* 6. 确定
*/
/**
@GZShi
GZShi / clone.js
Created November 21, 2014 03:33
Object clone
function clone(obj) {
return JSON.parse(JSON.stringify(obj));
}
http://www.zhihu.com/question/20160414
@GZShi
GZShi / bug.html
Created March 31, 2015 13:06
iOS 8.2 safari fixed position bug
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="blue">
<title>bug</title>
<style>
.nav {
@GZShi
GZShi / designer.html
Last active August 29, 2015 14:19
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<polymer-element name="my-element">
<template>
var fastItoa = (function () {
// 使用 2n 作为索引
var table = [
'0', '0',
'0', '1',
'0', '2',
...
'9', '8',
'9', '9'
];
@GZShi
GZShi / sock5-server.js
Last active April 9, 2016 09:02
根据RFC1928实现的一个sock5代理服务器,基于nodejs。已知bug:存在内存泄露
'use strict';
const net = require('net');
const local = '0.0.0.0';
const port = 1081;
var connSeq = 0;
const server = net.createServer((client) => {
var seq = connSeq++;
var uid = 1;
@GZShi
GZShi / snh48buyticket.js
Last active May 8, 2016 03:38
SNH购票…
(function () {
if (location.host !== 'shop.48.cn') {
console.error('kidding me?');
return ;
}
if (typeof jQuery !== 'function') {
console.error('缺少基础库');
return ;
}