function(){
\```
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox = "0 0 2000 2000" width="1000" height="400"> | |
<defs> | |
<clipPath id="myClip"> | |
<rect id="myClipRect" x="0" y="0" width="2000" height="2000"/> | |
</clipPath> | |
</defs> | |
<rect x="0" y="0" width="2000" height="2000" fill="#bbb"/> | |
<rect id="rect" x="0" y="500" width="0" height="50" fill="red"/> | |
<rect id="rect2" x="0" y="600" width="0" height="50" fill="blue"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> | |
<title>兼容kissy1.2~1.4的extend</title> | |
</head> | |
<body> | |
<!-- 改成1.4.0 进行测试--> | |
<script charset="utf-8" src="http://g.tbcdn.cn/kissy/k/1.3.0/seed.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>kissy 自定义事件对象(Custom EventTarget) </title> | |
</head> | |
<body> | |
<script charset="utf-8" src="http://g.tbcdn.cn/kissy/k/1.4.0/seed.js"></script> | |
<script type="text/javascript"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> | |
<link rel="stylesheet" href="http://a.tbcdn.cn/p/global/1.0/global-min.css" /> | |
<title>Raphaeljs 平滑的连接端点</title> | |
<style type="text/css" media="screen"> | |
.con{ | |
border:1px solid #999;width:700px;height:350px;margin:10px 0 0 10px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> | |
<link rel="stylesheet" href="http://a.tbcdn.cn/p/global/1.0/global-min.css" /> | |
<title>Raphaeljs 绘制十字线</title> | |
<style type="text/css" media="screen"> | |
.con{ | |
border:1px solid #999;width:700px;height:350px;margin:10px 0 0 10px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> | |
<link rel="stylesheet" href="http://a.tbcdn.cn/p/global/1.0/global-min.css" /> | |
<title>Raphaeljs 绘制网格</title> | |
<style type="text/css" media="screen"> | |
.con{ | |
border:1px solid #999;width:700px;height:350px;margin:10px 0 0 10px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
想学 clojure 是因为看到一篇 blog ,在 pc 上支持 600k 的并发,太疯狂了,比 Node.js | |
的 250k 两倍还多,于是就心痒痒。并且 clojure 是 lisp 的方言,已知对 lisp 很有兴趣, | |
但是好像它被一些人人视为「玩具」——除非你特别牛,用它是找不到工作的。而clojure和 | |
Java一样,是基于JVM的语言,所以它可以真的投入使用,比如 Storm 就是 clojure 的应用。 | |
1. clojure 的高并发能力 | |
- 因为它是 lock-free 的 [5] | |
2. Mac 下安装lein | |
在已经有 Java 环境的情况下,安装非常简单: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// **跨浏览器的事件模拟** | |
// @keyword event-simulate,dispatchEvent,fireEvent,事件模拟 | |
// @author [email protected] | |
// 现有的功能库非常长,而且基本都抄自 yui 的代码 | |
// 比如: | |
// - https://github.com/totorojs/event-simulate | |
// - https://github.com/dxq613/event-simulate | |
// 有时我们只需要模拟简单的几个事件,这时候去 copy 一大段代码,或引入一个第三方库,显得不切实际 | |
// 有一个 jQuery 的插件很小 | |
// - https://github.com/eduardolundgren/jquery-simulate/blob/master/jquery.simulate.js |
在 JavaScript 中,创建一个 表达式 —— 通常是一个 函数表达式 时,这个函数以及创建函 数时的 环境 共同构成了 闭包 。
举个例子,一个数数的函数:
function Counter(){
var n = 0;
return function(){
n++;