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 为什么写测试
1. 我不希望每次做完一个个新功能的时候,再手动地去测试一个个功能。(自动化测试)
2. 我不希望在重构的时候发现破坏了原来的功能,而我还一无所知。
3. 我不敢push代码,因为我没有把握。
@yardfarmer
yardfarmer / inherit.html
Last active Oct 4, 2015
js inherit method
View inherit.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<script src="../lib/jquery.js"></script>
<script src="../lib/seedrandom.js"></script>
<script type="text/javascript" charset="utf-8">
if (typeof Object.create !== "function")
View generate_demo_list.sh
#!/bin/bash
ls ../demo | awk 'BEGIN{ print "[" } {split($0,item,"_"); print "{\"url\":\"/demos\/"$0"\", \"name\":\""item[1]"\" ,\"tags\":\""item[2]"\",\"desc\":\""item[3]"\"}"} END{ print "{\"url\":\"\"} ]" }' > ../_data/demos.json
View 2014-11-09-length==+length.md
layout date title
post
2014-11-09 14:41:06 +0800
length==+length

读 underscroe 源码的时候看到了

var length = obj.length;
View h5_history_pushstate.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>
</title>
</head>
<body>
<h1 id='number'>1</h1>
View goodCode.js
var a = 1;
var b = ++a; // b = 2, a = 2;
a = 1;
b = a++; // b = 1; a = 2;
function deepCopy() (parent, child) {
var i,
toStr = Object.propotype.toString,
// x: arrName = '[Object Array]';
View inheritance-by-copying-properties.html
<!doctype html>
<html lang="en">
<head>
<title>JavaScript Patterns</title>
<meta charset="utf-8">
</head>
<body>
<script>
/* Title: Inheritance by Copying Properties
Description: an object gets functionality from another object, simply by copying it
View form.html
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
<meta name='viewport' content='width=device-width, initial-scale=1.0'
<title>HTML5 Form</title>
</head>
<body>
<div id="bin"></div>
<form>
View note.js
:#javascript 权威指南笔记
## 第1章 概述
## 第2章 词法结构
所谓直接量(literal) .就是程序中直接使用的数据值
## 第3章 类型、值和变量
Javascript 是一种面向对象的语言。这意味着不再需要定义全局的函数去操作不同类型的值——数据类型本身可以定义方法来使用值。
数字、布尔值、nullundefined属于不可变类型
View gist:be7e3b17f13558f70f13
安禅制毒龙
绝望
江河日下兮,颓废边缘之边。危亡之机,不能自已。怨天,怨地,怨自己。然,条条道理,心中清晓;种种诱惑,追追不已。心绪浮躁,气虚脑涨.
改变
舍大而持小。虽小,每日精进,亦强于无所作为,抱残守缺。不以恶小而为之,不以善小而不为。万般谋虑,不如步步为营。
涅槃
七日百步,为始。循序而进,渐入佳境。
You can’t perform that action at this time.