Skip to content

Instantly share code, notes, and snippets.

View yardfarmer's full-sized avatar

explorer yardfarmer

  • Alibaba.inc
  • HangZhou
View GitHub Profile
@yardfarmer
yardfarmer / index.html
Last active April 11, 2016 15:27 — forked from anonymous/index.html
节流函数 JS Bin // source https://jsbin.com/cufuyi
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@yardfarmer
yardfarmer / jsbin.pinade.js
Last active April 11, 2016 15:27 — forked from anonymous/index.html
函数 kerry 化 // source https://jsbin.com/pinade
function splat(fn) {
return function(array) {
// 充分利用了 apply 拆分数组的特性
return fn.apply(null, array);
};
}
// 传入一个函数,返回另外一个函数
var func = splat(function(x, y) {
return x + y;
@yardfarmer
yardfarmer / dabblet.css
Created May 22, 2016 07:36 — forked from csssecrets/dabblet.css
Flexible quarter ellipse
/**
* Flexible quarter ellipse
*/
div {
display: inline-block;
width: 16em;
height: 10em;
margin: 1em;
background: #fb3;
@yardfarmer
yardfarmer / dabblet.css
Last active May 22, 2016 09:33 — forked from csssecrets/dabblet.css
Elastic transitions
/**
* Elastic transitions
*/
input:not(:focus) + .callout:not(:hover) {
transform: scale(0);
transition: .25s transform;
}
.callout {
@yardfarmer
yardfarmer / dabblet.css
Created May 22, 2016 09:48 — forked from csssecrets/dabblet.css
Frame-by-frame animations
/**
* Frame-by-frame animations
*/
@keyframes loader {
to { background-position: -800px 0; }
}
.loader {
width: 100px; height: 100px;
@yardfarmer
yardfarmer / dabblet.css
Last active June 9, 2016 07:03 — forked from csssecrets/dabblet.css
Taming table column widths
/**
* Taming table column widths
*/
body { background: #ddd }
section {
width: 500px;
margin: 2em;
background: white;