摘要: npm install -g cnpm --registry=https://registry.npm.taobao.org 阅读全文
posted @ 2016-12-19 21:08 sunbey80 阅读(174) 评论(0) 推荐(0) 编辑
摘要: ! mongodb注意点:数据表名称一定要用复数,比如users,在使用model引用时也必须复数 阅读全文
posted @ 2016-12-14 15:06 sunbey80 阅读(2483) 评论(0) 推荐(0) 编辑
摘要: 添加依赖到package.json 实时刷新 删除文件/文件夹 linux 删除某类型文件 阅读全文
posted @ 2016-12-12 10:43 sunbey80 阅读(288) 评论(0) 推荐(0) 编辑
摘要: /*common*/ body{ color:#666666; font-size:12px; margin:0; padding:0; font-family:"Arial","Microsoft YaHei"; } form,ul,li,p,h1,h2,h3,h4,h5,h6,img,em,i,strong,input{ margin:0; ... 阅读全文
posted @ 2016-11-09 11:02 sunbey80 阅读(248) 评论(0) 推荐(0) 编辑
摘要: Learn React & Webpack by building the Hacker News front page from https://github.com/theJian/build-a-hn-front-page 1.安装nodejs 2.安装webpack 3.安装webpack- 阅读全文
posted @ 2016-11-08 13:29 sunbey80 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 手机端视窗控制 阅读全文
posted @ 2016-10-24 16:05 sunbey80 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Jsonp.html JsonpS.js 另:CORS跨域请求 http://blog.csdn.net/fdipzone/article/details/46390573/ 阅读全文
posted @ 2016-10-13 14:02 sunbey80 阅读(200) 评论(0) 推荐(0) 编辑
摘要: var jsonData = {a:1,b:2}; function obj2string(o) { var r = []; if (typeof o == "string") { return "\"" + o.replace(/([\'\"\\])/g, "\\$1").replace(/(\n)/g, "\\n").replace(/(\r)/g, "\\... 阅读全文
posted @ 2016-10-13 11:22 sunbey80 阅读(8321) 评论(0) 推荐(0) 编辑
摘要: cross_sub.html sub.html http://a.test.com/sub.html 发起请求,通过提升域和引入iframe的方式,获取iframe子域中所请求接收的数据。 阅读全文
posted @ 2016-10-11 11:59 sunbey80 阅读(598) 评论(0) 推荐(0) 编辑
摘要: 1.Vimium 阅读全文
posted @ 2016-09-30 13:56 sunbey80 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 1.Package Control 安装插件 2.Material Theme 主题 3.Emmet 自动HTML标签 4.Snippets JS自动片段 5.Advance newfile 文件夹下新建 6.DocBlockr 注释 7.SublimeLinter JS语法校验 8.Nettuts 阅读全文
posted @ 2016-09-30 13:14 sunbey80 阅读(515) 评论(0) 推荐(0) 编辑
摘要: 测试网址:www.regexper.com www.jsbin.com 例:匹配数字类型(正整数和小数) var reg = /^\d+\.?\d*$/ string.match(reg); //true or false; 标记速记: . 任意字符 除回车换行 \d 数字 ? 0个或者1个 + 1 阅读全文
posted @ 2016-09-27 16:32 sunbey80 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 我是一个居中的文档框 nodejs在调用某个包时,会检查包中package.json文件的main字段,将其作为包的接口模块,如果package.json或main字段不存在,会尝试寻找index.js或index.code作为包... 阅读全文
posted @ 2016-09-23 14:54 sunbey80 阅读(328) 评论(0) 推荐(0) 编辑
摘要: var g = function(str){ if(str.substr(0,1)==="."){ return document.getElementsByClassName(str.substr(1)); }else if(str.substr(0,1)==="#"){ return document.getElementById(st... 阅读全文
posted @ 2016-08-30 20:37 sunbey80 阅读(145) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2016-08-30 15:27 sunbey80 阅读(1) 评论(0) 推荐(0) 编辑
摘要: html css js json 阅读全文
posted @ 2016-08-17 11:09 sunbey80 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 一、数据类型 1.原始类型:number、string、boolean、null、undefined 2.对象类型:Object (Function、Array、Date...) P.类型隐式转换:'32'-2=30 //自动将字符串32转换为数字32 P.==和 : '1.23'==1.23,0= 阅读全文
posted @ 2016-08-09 10:27 sunbey80 阅读(136) 评论(0) 推荐(0) 编辑
摘要: nodejs概念: 让javascript运行在服务端的开发平台。不是一种语言,不是框架,不是库。特点:单线程异步、事件驱动。 PHP、JAVA既是语言也是平台。 创始人:Ryan nodejs cmd 命令: node -v //查看nodejs版本 node -e "console.log('o 阅读全文
posted @ 2016-07-29 11:56 sunbey80 阅读(198) 评论(0) 推荐(0) 编辑
摘要: var EventEmitter = require("events").EventEmitter var event = new EventEmitter() event.on("some_event",function(){ console.log("I'm a event") }) setTimeout(function(){ event.emit("some_event"... 阅读全文
posted @ 2016-07-26 16:43 sunbey80 阅读(172) 评论(0) 推荐(0) 编辑
摘要: var fs = require("fs") fs.readFile("file.txt","UTF-8",function(err,data){ if(err){ console.log("err") }else{ console.log(data) } }) console.log("end"); 阅读全文
posted @ 2016-07-26 15:49 sunbey80 阅读(168) 评论(0) 推荐(0) 编辑