Skip to content

Instantly share code, notes, and snippets.

@tony1223
tony1223 / pom.xml
Created May 23, 2011 03:20
如果你想把dependency的jar都搬出來,可以用這隻maven plug-in
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
@tony1223
tony1223 / gist:1076737
Created July 11, 2011 20:38
AbstractComponent.java
protected int countChild(){
int n = getChildren().size();
List comps = getChildren();
for(int i = 0 ; i < comps.size() ;++i){
AbstractComponent comp = (AbstractComponent) comps.get(i);
n += comp.countChild();
作者 Tony1223 (骨頭) 站內 Flyword
標題 現在是清晨五點
時間 Wed Aug 11 05:00:20 2004
───────────────────────────────────────
剛剛三點多出門買個東西,
街道還是一樣的寧靜,就像是那個陪我成長的小鄉村,
掛記(二) 詞/曲:Tony1223
那孤獨的同心門 靜靜地望著天際
滿天閃爍的夜 一個人獨自回億
成長歲月不懂真情 透不過氣的秘密
搖晃時間的鐘擺 踏著生命的舞曲
#想付出全心全意 現代愛情難以相信
寂寞 嘆息 星夜裡 仍有淡淡的柔情
import java.io.IOException;
import java.util.Iterator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.tools.ant.filters.StringInputStream;
防閒置:^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[DU^[[CU^[[C
BBS自動回訊
[3. ANGEL 小天使神諭呼叫器: 開放]/[33^M^M]
[3. ANGEL 小天使神諭呼叫器: 停收]/[3^M^M]
google.visualization.Query.setResponse({"version":"0.6","status":"ok","sig":"598319012","table":{"cols":[{"id":"A","label":"Element","type":"string","pattern":""},{"id":"B","label":"Percent","type":"number","pattern":"#0.###############"}],"rows":[{"c":[{"v":"iron"},{"v":32.1,"f":"32.1"}]},{"c":[{"v":"oxygen"},{"v":30.1,"f":"30.1"}]},{"c":[{"v":"silicon"},{"v":15.1,"f":"15.1"}]},{"c":[{"v":"magnesium"},{"v":13.9,"f":"13.9"}]},{"c":[{"v":"sulfur"},{"v":2.9,"f":"2.9"}]},{"c":[{"v":"nickel"},{"v":1.8,"f":"1.8"}]},{"c":[{"v":"calcium"},{"v":1.5,"f":"1.5"}]},{"c":[{"v":"aluminium"},{"v":1.4,"f":"1.4"}]}]}});
<%
if session("start") = nothing then
session("start") = "ok"
session("mytime") = DateAdd('s',12,now)
now
end if
if session("mytime") < now then
response.write( "<html>")
@tony1223
tony1223 / server.js
Created August 5, 2012 22:27
nodejs to submit a http request
require('http');
function wget (host, path, https, callback) {
var port = (https)? 443: 80,
client = http.createClient(port, host, https),
request = client.request('get', path, { 'host': host }),
response_body = [];
request.end();
var http = require('http'),
Iconv = require('iconv').Iconv;
function wget (host, path, callback,encoding /* optional */) {
var iconv = null;
if (encoding){
iconv = new Iconv(encoding,'UTF-8//TRANSLIT//IGNORE');
}
var options = {