Skip to content

Instantly share code, notes, and snippets.

try {
if (!window.openDatabase) {
alert('not supported');
} else {
var shortName = 'mydatabase';
var version = '1.0';
var displayName = 'My Important Database';
var maxSize = 65536; // in bytes
var db = openDatabase(shortName, version, displayName, maxSize);
@chengmu
chengmu / deleteEnglishLine.js
Created April 19, 2014 07:20
用于删除译稿中英文的脚本
/**
* 用于删除翻译完的稿子中英文部分的脚本
*/
var resultFileName = 'r.txt';
var inputFileName = 'raw.txt';
var fs = require('fs');

#HTTP 记录HTTP标准的一些基础概念和参考。 ##基础

###TCP/IP __TCP/IP__指与互联网相关连的协议的集合。

####分层管理模型 好处 :分好层次,规划好每层之间接口后,方便维护和更改具体设计。

@chengmu
chengmu / API_history.md
Last active August 29, 2015 14:02
History
@chengmu
chengmu / dabblet.css
Created November 29, 2012 09:12
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.shine{
height:100px;
width:100px;
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 10
(function(window, document, undefined){
})(this, document)
//anything apart from window and document get passed into it will be treated as undefined;
//this could forbidden the undefined asserssments error
var someDate = new Date();
var numberOfDaysToAdd = 6;
someDate.setDate(someDate.getDate() + numberOfDaysToAdd);
@chengmu
chengmu / Base.js
Last active December 18, 2015 23:09
《Javascript core and practice》notes
/*
Base.js, version 1.1a
Copyright 2006-2010, Dean Edwards
License: http://www.opensource.org/licenses/mit-license.php
*/
var Base = function() {
// dummy
};
@chengmu
chengmu / [Trans]Rendering.md
Created July 8, 2013 07:31
Translation of 5R

####本文编译自Rendering: repaint, reflow/relayout, restyle 所有权利保留为原作者所有

##渲染: 重绘,回流/重布局,重设样式 ###渲染过程

不同的浏览器实现不同,但下面图表所示过程基本都足以表示各个浏览器一旦下载完毕代码,接下来做了些什么。

渲染过程

(function () {
var a = window.a = {
name : 'a'
};
var aStr = window.aStr = 'stringA';
window.a.name = 'b';
window.aStr = 'stringB';