Skip to content

Instantly share code, notes, and snippets.

View fundon's full-sized avatar
🎯
Focusing

Fangdun Tsai fundon

🎯
Focusing
View GitHub Profile
@fundon
fundon / schema.sql
Created June 7, 2011 02:29
Oracle SQLS
-- master - slaver 主从流复制
-- 什么情况下才会对流复制造成影响
-- 主从数据不一致,或者从库上有的对象,主库又新建相同的对象
-- tables
SELECT * FROM user_tables
SELECT * FROM user_tab_comments WHERE table_name = upper(:name)
SELECT lower(t.column_name) column_name
@fundon
fundon / hosts
Created June 10, 2011 05:48
/etc/hosts or C:\WINDOWS\system32\drivers\etc\hosts
# IPV4
## github
207.97.227.245 www.github.com
## google
203.208.39.22 webcache.googleusercontent.com
203.208.39.22 mail.google.com
203.208.39.22 reader.google.com
203.208.39.22 www.google.com.hk
@fundon
fundon / Bits.js
Created June 20, 2011 06:59
What can you do with bytes?
// notes: http://jsperf.com/transloc-getters
// http://www.bytearray.org/?p=711
// testing in Nodejs console
function Bits() {
this._buffer = 0;
this._length = 0;
// 写入时虚拟指针
this._wpointer = 0;
@fundon
fundon / mapreduce.js
Created June 29, 2011 10:11 — forked from adomado/mapreduce.js
Simple MapReduce with Javascript
var Job = {
data : [
"We are glad to see you here. This site is dedicated to",
"poetry and to the people who make poetry possible",
"poets and their readers. FamousPoetsAndPoems.com is",
"a free poetry site. On our site you can find a large",
"collection of poems and quotes from over 631 poets",
"Read and Enjoy Poetry",
"I, too, sing America",
@fundon
fundon / aop.php
Created July 6, 2011 09:40
PHP, Aspect Oriented Programming(AOP). @author: wuzhenyu
<?php
function e($str){echo $str , "\n";}
class AOP
{
static function getInstance()
{
$args = func_get_args();
$class = array_shift($args);
@fundon
fundon / website
Created July 6, 2011 10:07
网站开发技术构想
###
design:
- base library // 基础库
- application core // 管理页面应用,页面管理中心
- sandbox // 沙箱,连接 app , 提供各 module 之间通信的沙箱通道
- module // 可以独立运行、可以即拔即插、对系统不造成影响
- component // 不可独立运行、依赖于系统
- js/css // 并行、依赖加载
browser:
@fundon
fundon / AOP.js
Created July 8, 2011 09:00
JavaScript, Aspect Oriented Programming(AOP)
function AOP(obj, advice) {
this._instance = obj;
this._advice = advice;
}
AOP.prototype = {
_method: null,
_params: null,
result: null,
setAdviceResult: function(result) {
this.result = result;
var number = 10;
var showNumber = function () {
alert(number);
}
(function () {
number = 20;
showNumber();
})()
@fundon
fundon / isIE.js
Created July 20, 2011 16:14
checking ie
!-[1,]
var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
var isMSIE = /*@cc_on!@*/false;
@fundon
fundon / Observer.js
Created July 21, 2011 18:14
Observer Design Pattern Using JavaScript
/*
Notes:
Observer Event Pub/Sub
add → bind → subscribe
remove → unbind → unsubscribe
notify → trigger → publish
topic → type → topic
*/
/**
* Observer Class