Skip to content

Instantly share code, notes, and snippets.

CYK yardfarmer

  • Alibaba.inc
  • HangZhou
Block or report user

Report or block yardfarmer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View normalize.css
/*! normalize.css v3.0.1 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
View dropdown.js
/* ========================================================================
* Bootstrap: dropdown.js v3.2.0
* http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
View popover.js
/* ========================================================================
* Bootstrap: popover.js v3.2.0
* http://getbootstrap.com/javascript/#popovers
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
@yardfarmer
yardfarmer / Class.js
Created Aug 19, 2014
构造自己的类
View Class.js
/**
* Class build my Own class
* Created by cyk on 14-8-19.
*/
/*
* 很巧妙的办法
*/
var Class = function() {
"use strict";
@yardfarmer
yardfarmer / Functionbind.js
Created Aug 20, 2014
Function.prototype.bind 实现方式
View Functionbind.js
/**
* Created by cyk on 14-8-20.
*/
if(!Function.prototype.bind) {
Function.prototype.bind = function(obj) {
"use strict";
// 很巧妙的获取了数组的静态方法 slice
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-git2.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div>
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>scrollLeft demo</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<style id="jsbin-css">
div.demo {
background: #ccc none repeat scroll 0 0;
View fullscreen.js
/**
* Full Screen plugin
* 2014-08-22 by cyk
**/
(function () {
var viewFullScreen = document.getElementById("view-fullscreen");
if (viewFullScreen) {
viewFullScreen.addEventListener("click", function () {
var docElm = document.documentElement;
View gist:c15c8c137fdb66551d6a
var searchTimeout,
searchDelay = 300;
$('#title').on('keyup', function(event) {
clearTimeout(searchTimeout);
searchTimeout = setTimeout(function() {
$ajaxForm.triggerHandler('submit');
}, searchDelay);
});
View posttogit.js
var a = 1;
var b = ++a; // b = 2, a = 2;
a = 1;
b = a++; // b = 1; a = 2;
You can’t perform that action at this time.