Skip to content

Instantly share code, notes, and snippets.

@tony1223
tony1223 / .irbrc
Created July 13, 2010 10:18
rails enviroment
# Just for Rails...
if rails_env = ENV['RAILS_ENV']
load File.dirname(__FILE__) + "/.railsrc"
rails_root = File.basename(Dir.pwd)
IRB.conf[:PROMPT] ||= {}
IRB.conf[:PROMPT][:RAILS] = {
:PROMPT_I => "#{rails_root}> ",
:PROMPT_S => "#{rails_root}* ",
:PROMPT_C => "#{rails_root}? ",
:RETURN => "=> %s\n"
fdgfdgfdgd
<zk>
<window id="win" border="normal" width="400px" height="500px">
<label id="hello" value="not changed" />
</window>
<script type="text/javascript">
zk.afterMount(function() { // do in this for zk is already loaded
function zk$( widgetId ){
return zk.Widget.$(jq("$"+widgetId));
}
class DBConfig{
}
interface ConfigLoader{
DBConfig loadConfig(String fileName);
}
interface DBEngine{
void openConnnection(DBConfig input);
void execute(List<MigrationRunner> list); //to db
package test.combobox;
import java.util.ArrayList;
public class Department {
private int id;
private String name;
public ArrayList<Employee> list;
function FindProxyForURL(url, host)
{
if (shExpMatch(url, "http://www.facebook.com*")) {
return "SOCKS5 localhost:1079";
}
if (shExpMatch(url, "*fbcdn*")) {
return "SOCKS5 localhost:1079";
}
if (shExpMatch(url, "*youtube*")) {
return "SOCKS5 localhost:1079";
package org.zkoss.usergroup.composer;
import org.zkoss.usergroup.dao.IMessageDao;
import org.zkoss.usergroup.dao.MessageDaoImpl;
import org.zkoss.usergroup.model.Message;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.event.ForwardEvent;
import org.zkoss.zk.ui.util.GenericForwardComposer;
<device-config>
<device-type>ajax</device-type>
<embed><![CDATA[
<script type="text/javascript">
(function(ozks){
window.zkx = function(){
var d = new Date();
ozks.apply(zk,arguments);
zk.afterMount(function(){
zk.log("zkx:"+(new Date().getTime() - d.getTime()) +"ms");
@tony1223
tony1223 / Main.js
Created May 9, 2011 16:09
plurk timeline review
// --{ whole TimeLine jumper (Start)
(function(){
//initial
if(!window.GLOBAL || !window.GLOBAL.page_user) return; //防止render錯頁
if(!window.TimeLine || window.TimeLine.jumper) return; //防止重複定義
//TimeLine Override Functions
TimeLine.getPlurks = function (e, config) {
config = config || {};
var c = TimeLine;
package runjettyrun;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;