定時重新整理網頁

// ==UserScript==
// @name          AutoReload
// @description   自動定時重新整理
// @include       http://elearning.npust.edu.tw/moodle/user/index.php?contextid=265782
// @version       2010-11-08
// ==/UserScript==
var infoBlock=document.createElement('p');
    infoBlock.style.position='absolute';
    infoBlock.style.top='10px';
    infoBlock.style.left='40px';
    infoBlock.style.fontSize='1.8em';
    infoBlock.innerHTML=1;
document.body.appendChild(infoBlock);
function AR(){
    var i=setInterval(function(){Info();},1000);
    setTimeout(function(){clearInterval(i);location.reload();},60*1000);
}
function Info(){
    infoBlock.innerHTML=parseInt(infoBlock.innerHTML,10)+1;
}
window.addEventListener('DOMContentLoaded',AR,false);

Places query URIs

找出最近新增已整理的Wretch相簿(20筆)
place:folder=BOOKMARKS_MENU&queryType=1&sort=12&maxResults=20&uri=http://www.wretch.cc/album&uriIsPrefix=true NOTE:
folder=BOOKMARKS_MENU → 書籤功能表
queryType=1 → 書籤(排除未排序書籤)
sort=12 → Sort by date added, most recent first.
maxResults=20 → 20筆資料
uri=http://www.wretch.cc/album → The URI to match.
uriIsPrefix=true → 過濾
Places query URIs - MDC Doc Center
Firefox書籤整理術:智慧書籤篇 - Mulberry的時間事件簿
Places query syntax • mozillaZine Forums
Places query URIs - MDC

Node.replaceChild()

var oldEle=document.querySelectorAll('#bigcontainer table')[2]; //Original Element
var newEle=document.createElement('div'); //New Element
oldEle.parentNode.replaceChild(newEle,oldEle);

Node.replaceChild - MDC Doc Center

Visual Studio 2008 中文字型

  1. OpenX:\Documents and Settings\Administrator\Application Data\Microsoft\VisualStudio\9.0
  2. 用任何文字編輯器打開VsFontLk.dat
  3. 找到0404|MingLiU|細明體
  4. 改成0404|Microsoft JhengHei|微軟正黑體
NOTE:
0404是16進制,對應10進制是1028,也就是繁體中文的lang id了。後面是字體。
解決Consolas在VS2008的中文顯示問題 - 黑暗執行緒

parseInt()

If the radix parameter is omitted, JavaScript assumes the following:
  • If the string begins with "0x", the radix is 16 (hexadecimal)
  • If the string begins with "0", the radix is 8 (octal). This feature is deprecated
  • If the string begins with any other value, the radix is 10 (decimal)

JavaScript parseInt() Function

字串補齊(padLeft)

padLeft function padLeft(str, lenght) {
    if (str.length >= lenght) return str;
    else return padLeft("0" + str, lenght);
}

PadLeft及PadRight @ 男丁格爾 in Xuite
convert '1' to '0001' in JavaScript - Stack Overflow