Skip to content

Instantly share code, notes, and snippets.

View kainy's full-sized avatar
:octocat:
Q Tiu HiuMiuLiu

Kainy Guo kainy

:octocat:
Q Tiu HiuMiuLiu
View GitHub Profile
@anhulife
anhulife / WeixinDetection.js
Created January 17, 2014 09:22
判断网页是否是在微信内嵌浏览器中打开
document.addEventListener('WeixinJSBridgeReady', function(){
//如果执行到这块的代码,就说明是在微信内部浏览器内打开的.
alert('当前页面在微信内嵌浏览器中打开!');
});
@wintercn
wintercn / gist:5918272
Created July 3, 2013 14:18
CSS3 标准和属性对应数据
[
{
"spec name": "CSS Animations",
"uri": "http://www.w3.org/TR/css3-animations",
"category": "css-property",
"Name": "animation-name",
"Value": "<single-animation-name> [\n ‘,’ <single-animation-name> ]*",
"Initial": "‘none’",
"Applies To": "all elements, ::before and ::after pseudo-elements",
"Inherited": "no",
@BrendanEich
BrendanEich / gist:5753666
Created June 11, 2013 00:36
ES6 version of Peter Norvig's Sudoku solver originally written in Python
// XXX should be standard (and named clone, after Java?)
Object.prototype.copy = function () {
let o = {}
for (let i in this)
o[i] = this[i]
return o
}
// Containment testing for arrays and strings that should be coherent with their iterator.
Array.prototype.contains = String.prototype.contains = function (e) {
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@remy
remy / html5-data.js
Created April 10, 2010 15:45 — forked from fearphage/html5-data.js
data-* support
(function () {
var forEach = [].forEach,
regex = /^data-(.+)/,
dashChar = /\-([a-z])/ig,
el = document.createElement('div'),
mutationSupported = false,
match
;
function detectMutation() {