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
/** | |
* 倒计时处理方法 (精确时间处理) | |
* | |
* @param {Number} seconds 剩余秒数/时间戳 | |
* @param {Function} callback 回调函数 | |
* @param {Boolean} timeStamp 是否时间戳 | |
* | |
* 使用例子 | |
* | |
* // 情况1:后台给的是倒计时 秒 |
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
// <audio src="bg.mp3" id="media" autoplay loop preload="auto"></audio> | |
var player = document.getElementById('media'); | |
player.play(); | |
// iphone 下要监听 WeixinJSBridgeReady 事件 | |
document.addEventListener('WeixinJSBridgeReady', function () { | |
player.play(); | |
}, false); |
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
#!/bin/sh | |
# | |
# git autodeploy script when it matches the string "[deploy]" | |
# | |
# @author icyleaf <icyleaf.cn@gmail.com> | |
# @link http://icyleaf.com | |
# @version 0.1 | |
# | |
# Usage: | |
# 1. put this into the post-receive hook file itself below |
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
function formatDate(date, formater) { | |
date = new Date(date); | |
var week = '日一二三四五六'; | |
var data = { | |
'y': date.getFullYear(), // 年 | |
'M': date.getMonth() + 1, // 月 | |
'd': date.getDate(), // 日 | |
'E': week.charAt(date.getDay()), | |
'h': date.getHours(), // 小时 |
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
$.ajax('?', {type:'head'}).done(function(data, status, xhr) { | |
var dt = new Date(xhr.getResponseHeader('Date')); // 字符串转日期对象 | |
console.log(dt.toLocaleString()); | |
}); |
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
var opener = parent.window.opener; | |
opener && (opener.location='http://www.baidu.com/'); |
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
var s = performance.now(); | |
/** | |
* Copyright (c) 2014-2015, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license found in the | |
* LICENSE file in the root directory of this source tree. An additional grant | |
* of patent rights can be found in the PATENTS file in the same directory. | |
*/ | |
(function () { 'use strict';var SLICE$0 = Array.prototype.slice; |
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
(function(window, undefined) { | |
// 编码 | |
function encode(str) { | |
return encodeURIComponent(JSON.stringify(str)); | |
} | |
// 解码 | |
function decode(str) { | |
if (undefined == str) { |
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
# Ignore all test and documentation for archive | |
/.gitattributes export-ignore | |
/.gitignore export-ignore | |
/.travis.yml export-ignore | |
/tests export-ignore | |
/docs export-ignore |
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
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="> |