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
var promise = require("./promise"); | |
promise.execute(function(callback){ | |
asyncOperation(callback); | |
}).then(function(result){ | |
console.log("on succ: ", result); | |
}, function(err) { | |
console.log("on fail: ", err); | |
}); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int escape(int[], int, int**); | |
int unescape(int[], int, int**); | |
int main() | |
{ | |
//test: 转义 | |
int data[] = {0x7E, 0x00, 0x02, 0x23, 0x11, 0xCB}; |
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>hover</title> | |
<style> | |
.btn { | |
width: 200px; | |
background-color: #080; | |
text-align: center; |
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>placeholder</title> | |
<style> | |
.placehoder_wrap {position: relative;} | |
.placehoder_wrap label {display: none; position: absolute; left: 3px; top: 1px; color: #ccc; font-size: 12px; padding: 3px; line-height: 20px; white-space: nowrap; cursor: text;} | |
.field {width: 200px; border: 1px solid #000; height: 20px; padding: 3px; font-size: 12px;} | |
textarea.field {width: 300px; height: 200px;} |
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>取得html页面里当前script标签节点</title> | |
</head> | |
<body> | |
<script id="test"> | |
var scripts = document.getElementsByTagName("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"> | |
<style> | |
.wrap { position: relative; width: 400px; height: 300px; border: 1px solid #000;} | |
.content {float: left; width: 100%; height: 300px; background-color: #ccc;} | |
.abs {position: absolute; left: 50px; top: 50px; padding: 5px 8px; background-color: #080; color: #fff; font-size: 14px;} | |
</style> | |
</head> |
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>Document</title> | |
<style> | |
.content { | |
width: 500px; | |
margin: 0 auto; | |
white-space: pre-wrap; |
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
/** | |
* 模板引擎 | |
* | |
* @param {String} template 模板,占位符默认是{} | |
* @param {Object} data 数据 | |
* @param {RegExp} regexp 用正则自定义占位符 | |
* return {String} | |
*/ | |
function render(template, data, regexp) { | |
if (!(Object.prototype.toString.call(data) === "[object Array]")) { |
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 name="viewport" content="width=device-width, maximum-scale=1" /> | |
<title>test touch</title> | |
<script src="http://img1.cache.netease.com/f2e/libs/zepto.js"></script> | |
<!-- <script src="zepto.js"></script> --> | |
<style> | |
.box { |
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
.transition(@val) { | |
-webkit-transition: @val; | |
-moz-transition: @val; | |
-ms-transition: @val; | |
-o-transition: @val; | |
transition: @val; | |
} | |
.transform(@val) { | |
-webkit-transform: @val; | |
-moz-transform: @val; |
OlderNewer