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 spawn = require('child_process').spawn; | |
var cmds = [["/c","dir"],["/c","java"],["/c","java","-jar"]] | |
// cmds.forEach(function(v){ | |
// v && exe(v); | |
// }); | |
//YUI compressor jar file folder | |
var ori = __dirname+"/../tools"; |
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
/* | |
判断JAVA是否安装 | |
*/ | |
var spawn = require('child_process').spawn; | |
exe(["/c","python","a"]); | |
/* | |
0: success |
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 | |
require_once("../../app/tpl-engine/Haanga.php"); | |
$str = " | |
Hi {{name}}! Welcome to Koubei.com | |
{# foreach #} | |
{% for n in numbers %} | |
<div>{{n}}</div> | |
{% endfor %} |
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 | |
require_once("../../app/tpl-engine/mustache.php/Mustache.php"); | |
///////////////////////////////////////////simple Hello world////////////////////////////// | |
$m = new Mustache; | |
echo $m->render('Hello {{planet}}', array('planet' => 'World!')); | |
// "Hello World!" | |
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 spawn = require('child_process').spawn; | |
exe(["/c","TortoiseProc","/command:commit","/path:../att.cmd","/logmsg:update"]); | |
/* | |
0: success |
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 | |
/** | |
* Access the HTTP Request | |
*/ | |
class http_request { | |
/** additional HTTP headers not prefixed with HTTP_ in $_SERVER superglobal */ | |
var $add_headers = array('CONTENT_TYPE', 'CONTENT_LENGTH'); | |
/** |
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 http = require('http'); | |
var fs = require('fs'); | |
function EncodeFieldPart(boundary,name,value) { | |
var return_part = "--" + boundary + "\r\n"; | |
return_part += "Content-Disposition: form-data; name=\"" + name + "\"\r\n\r\n"; | |
return_part += value + "\r\n"; | |
return return_part; | |
} |
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 rl = require('readline'); | |
// 一级提示 | |
var completionsCMD = ["help","deploy","compress","console"]; | |
var completionsFILES = ["abc.js","bca.js","cba.js"]; | |
var rli = rl.createInterface(process.stdin,process.stdout,function(line){ | |
// excute when Tab pressed | |
// only process the last one | |
_line = line;//for restore |
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
#eg 1 | |
from BeautifulSoup import BeautifulSoup | |
import re | |
html_text = """ | |
<h2>this is cool #12345678901</h2> | |
<h2>this is nothing</h2> | |
<h2>this is interesting #126666678901</h2> | |
<h2>this is blah #124445678901</h2> |
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
import sys, time, os | |
from mechanize import Browser | |
LOGIN_URL = 'http://www.example.com/login' | |
USERNAME = 'DavidMertz' | |
PASSWORD = 'TheSpanishInquisition' | |
SEARCH_URL = 'http://www.example.com/search?' | |
FIXED_QUERY = 'food=spam&' 'utensil=spork&' 'date=the_future&' | |
VARIABLE_QUERY = ['actor=%s' % actor for actor in | |
('Graham Chapman', |