Skip to content

Instantly share code, notes, and snippets.

@jinwei233
jinwei233 / addStyleSheet.html
Created June 24, 2011 09:13
artDialog note ——动态添加样式表
<!doctype html>
<html>
<head>
<title>demo</title>
<style type="text/css" media="screen">
</style>
</head>
<body>
<div id="test">
@jinwei233
jinwei233 / clearSelect.html
Created June 24, 2011 09:24
取消文字选中
<!doctype html>
<html>
<head>
<title>demo</title>
<meta charset='utf-8'/>
<style type="text/css" media="screen">
</style>
</head>
<body>
<div id="test">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Custom Buttons 3.1 (demo)</title>
<style type="text/css">
body {
background:#fff;
padding:20px;
@jinwei233
jinwei233 / diff-demo.html
Created August 23, 2011 11:19
diff match patch
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>Diff, Match and Patch: Demo of Diff</TITLE>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="http://google-diff-match-patch.googlecode.com/svn/trunk/javascript/diff_match_patch_test.js"></SCRIPT>
</HEAD>
<BODY>
<H1>Diff, Match and Patch</H1>
<html>
<head>
<title>test page</title>
<script type='text/javascript'>
<!--
方法 运行时间(ms)
方法一 93037
方法二 3341
方法三 2795
方法四 500
@jinwei233
jinwei233 / test_port.js
Created September 15, 2011 12:22
检查host是否可用
var options = {
host: 'www.google.com',
port: 80,
path: '/index.html'
};
http.get(options, function(res) {
if (res.statusCode == 200) {
console.log("success");
}
@jinwei233
jinwei233 / 批处理笔记.bat
Created September 16, 2011 12:05
批处理笔记
shell 获取当前目录
设置环境变量
打印环境变量
%0 是指批处理文件本身
%~dp0 是对%0的扩展,d是drive,也就是盘符,p是路径,所以%~dp0是指批处理所在的路径(包括盘符)
pushd是设定工作目录
所以 PUSHD %~dp0 就是设定批处理所在的目录为工作目录
"%~dp00PE_0606_for_ud"也就是批处理所在目录下0PE_0606_for_ud目录
@jinwei233
jinwei233 / setEnv.bat
Created September 16, 2011 12:29
NodeJs设置搜寻路径 通过批处理设置搜寻路径
@echo off
echo welcome to att3 alpha...
path %PATH%;%~dp0..\node\bin\
path %PATH%;%~dp0tools\
node test.js
@jinwei233
jinwei233 / test_exec.js
Created September 16, 2011 12:30
NodeJs执行系统命令
var spawn = require('child_process').spawn;
var cmds = [["/c","dir"],["/c","java"],["/c","java","-jar"]]
cmds.forEach(function(v){
v && exe(v);
});
function exe(command){
@jinwei233
jinwei233 / set_path.js
Created September 16, 2011 12:47
NodeJs 路径获取 格式转换
/**
获取当前路径 && 路径转换
*/
var cwd = process.cwd();
console.log("-----------------------");
console.log("cwd:",cwd);
console.log("-----------------------");
console.log("-----------------------");