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
define("common:lib/base.js",function( | |
require, exports, module | |
){ | |
exports.sayhi = function( some_one) { | |
console.log( 'hello, ' + some_one ); | |
} | |
}); | |
define('widget:tip',function( | |
require, exports, module |
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
<?php | |
$deploy_root=dirname(__FILE__); | |
function mkdirs($path, $mod = 0777) { | |
if (is_dir($path)) { | |
return chmod($path, $mod); | |
} else { | |
$old = umask(0); | |
if(mkdir($path, $mod, true) && is_dir($path)){ |
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 _ = require('underscore'); | |
var request = require('request'); | |
var async = require('async'); | |
console.log('/*'); | |
var checkApi = _.template('http://www.google.com/doodles/json/<%=year%>/<%=month%>'); | |
async.reduce(_.range(1998,2013+1),[],function( cache ,year, yeardone) { | |
console.log( 'year', year ); | |
var fullyear = []; | |
async.eachLimit(_.range(1,12+1), 5, function( month, monthdone ) { | |
console.log( 'month', month ); |
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 fs = require('fs'); | |
var _temp = [fs.readdirSync('Packages'), | |
fs.readdirSync('Pristine Packages')] | |
_temp[1] = _temp[1].map(function( line ) { | |
return line.replace(/\.sublime-package$/,''); | |
}); | |
var _ = require('underscore'); | |
var ret = _.without.apply(null, ( _temp[1].splice(0,0,_temp[0]), _temp[1] ) ); |
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 child_process = require('child_process'); | |
module.exports = function check_linux_port ( port_range, done ) { | |
var check = child_process.exec('netstat -tln'); | |
var res = ''; | |
check.stdout.on('data',function(chuck) { | |
res+= chuck; | |
}); | |
check.on('exit',function(code) { |
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
function intToChinese (str) { | |
str = str + ''; | |
var len = str.length - 1; | |
var idxs = ['', '十', '百', '千', '万', '十', '百', '千', '亿', '十', '百', '千', '万', '十', '百', '千', '亿']; | |
var num = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']; | |
return str.replace(/([1-9]|0+)/g, function($, $1, idx, full) { | |
var pos = 0; | |
if ($1[0] != '0') { | |
pos = len - idx; |
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
define([],function() { | |
var iframe=document.createElement("iframe"); | |
iframe.src="about:blank"; | |
iframe.setAttribute("style","display:none;visibility:hidden;"); | |
document.body.appendChild(iframe); | |
var d=iframe.contentWindow.document; | |
d.charset=d.characterSet="GBK"; | |
function getGBKEscape(s) { | |
d.write("<body><a href='?"+s+"'>X</a></body>"); | |
d.close(); |
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
.ace-autocomplete-dialog{ | |
position:absolute; | |
top:0;left:0; | |
min-width:200px; | |
max-height:196px; | |
overflow:hidden; | |
font-size:12px; | |
display:none; | |
box-shadow:0 0 5px 1px rgba(0, 0, 0, 0.3); | |
background:#E8E8E8; |
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 child_process = require('child_process'); | |
var iconvLite = require('iconv-lite'); | |
var csv = require('csv'); | |
var util = require('util'); | |
var events = require('events'); | |
var _ = require('underscore'); | |
var tracecpu = child_process.spawn('typeperf', ["\\Memory\\Available bytes","\\processor(_total)\\% processor time"]); | |
var lastRecord, |
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
function orderedFlow ( order ) { | |
this.order = order; | |
this.listnerId = uuid('orderedFlow.'); | |
this.dataStack = []; | |
this.index = 0; | |
this.interval = 0; | |
this.maxListen= 500; | |
this.nextTime = 0; | |
this.timeout = undefined; |
NewerOlder