Skip to content

Instantly share code, notes, and snippets.

@biao166
biao166 / analytics.js
Created May 11, 2018 16:55 — forked from zmmbreeze/analytics.js
GA的源码 analytics.js
(function() {
/**
* 记录方法使用情况的类
* @param {Array.<boolean>} umMap 初始的使用情况
*/
var UsageManager = function(umMap) {
this.umMap = umMap || [];
};
/**
* 记录新的使用情况
@biao166
biao166 / cloudSettings
Created September 20, 2017 06:35
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-09-20T06:34:48.155Z","extensionVersion":"v2.8.3"}
@biao166
biao166 / batch.bat
Created September 8, 2017 06:55 — forked from bangonkali/batch.bat
Attaching Notepad++ to git commit editor.
git config core.editor "'C:\Program Files (x86)\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
/*
* Copyright (c) 2010 Apple Inc. All rights reserved.
*/
function characterNeedsScoreMultiplier(e) {
if (!e || e.length === 0)
return !1;
var t = e.charCodeAt(0);
return t > 11904 && t < 12031?!0 : t > 12352 && t < 12543?!0 : t > 12736 && t < 19903?!0 : t > 19968 && t < 40959?!0 : t > 44032 && t < 55215?!0 : t > 63744 && t < 64255?!0 : t > 65072 && t < 65103?!0 : t > 131072 && t < 173791?!0 : t > 194560 && t < 195103?!0 : !1
}
function domDistance(e, t, n) {
@biao166
biao166 / vpnsetup.sh
Last active August 29, 2015 14:13 — forked from hwdsl2/.MOVED.md
#!/bin/sh
#
# Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN
# on a Ubuntu server instance. Tested with 14.04 (Trusty) AND 12.04 (Precise).
# With minor modifications, this script *can also be used* on dedicated servers
# or any KVM- or XEN-based Virtual Private Server (VPS) from other providers.
#
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! THIS IS MEANT TO BE RUN WHEN
# YOUR AMAZON EC2 INSTANCE STARTS!
#
@biao166
biao166 / encodeParameters
Created October 23, 2014 03:19
js 函数
var encodeParameters = function(arg, parameters) {
var paras = [];
for (var x in parameters) {
paras.push($window.escape(x) + '=' + $window.escape(parameters[x]));
}
return paras.length > 0 ? (arg === -1 ? '?' : '&') + paras.join('&') : '';
};

CSS Callback Functions Using Iteration

A method of using javascript to give CSS animations and transitions a type of "callback function". This example uses animation iteration as opposed to the other example which uses animation end

A Pen by Zach Saucier on CodePen.

License.

Reversing CSS Rotation Smoothly on Hover

In order to accomplish this goal a container element is required. The trick is to have the same rotation animations apply to both the container and the content, but have them go in opposite directions and have one twice as quick as the other. Thus you pause the quicker one and unpause it on hover. NOTE: In Chrome there is currently a small glitch when transitioning after the first transition

Forked from Zach Saucier's Pen Reversing CSS Rotation Smoothly on Hover.

A Pen by Anonasaurus Rex on CodePen.

License.

常用的 HTML 头部标签

详细介绍参见原文:yisibl/blog#1

<!DOCTYPE html> <!-- 使用 HTML5 doctype,不区分大小写 -->
<html lang="zh-cmn-Hans"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa -->
<head>
    <meta charset='utf-8'> <!-- 声明文档使用的字符编码 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <!-- 优先使用 IE 最新版本和 Chrome -->