FORFILES /S /M *.jpg /C "cmd /c move @file .."
標籤
.net
(
17
)
工作
(
29
)
面試
(
2
)
筆記
(
2
)
筆記倉庫
(
1
)
嘸蝦米
(
2
)
繪圖
(
1
)
Add-on
(
4
)
Android
(
39
)
AngularJS
(
1
)
ASP.NET
(
14
)
AutoHotKey
(
20
)
AutoIt
(
3
)
batch
(
24
)
Blogger Hack
(
3
)
Bookmarklet
(
18
)
C#
(
16
)
Chrome
(
1
)
cmd
(
22
)
CSS
(
6
)
CSS3
(
6
)
D855
(
1
)
DOM
(
17
)
DragOnIt
(
5
)
EmEditor
(
1
)
English
(
1
)
ffmpeg
(
1
)
Firefox
(
25
)
flo
(
2
)
GIMP
(
1
)
gist
(
144
)
Graphviz
(
1
)
hardware
(
1
)
HDD
(
1
)
HTML5
(
4
)
i18n
(
1
)
IIS
(
4
)
ImageMagick
(
5
)
Java
(
1
)
JavaScript
(
92
)
jhead
(
1
)
jQuery
(
6
)
JSBin
(
19
)
jsFiddle
(
4
)
JSON
(
1
)
JustDoubleClick
(
1
)
Kindle
(
1
)
MSSQL
(
26
)
MySQL
(
2
)
Network
(
1
)
node.js
(
12
)
php
(
1
)
PowerShell
(
6
)
ramdisk
(
1
)
Reg
(
3
)
RegExp
(
3
)
rpi3
(
3
)
SJ2000
(
1
)
SQLite
(
3
)
SSD
(
1
)
Stylish
(
1
)
SublimeText
(
2
)
tips
(
6
)
userChrome.js
(
3
)
userscript
(
40
)
VB.net
(
9
)
VBScript
(
2
)
VisualStudio
(
2
)
Vue.js
(
3
)
Win
(
5
)
Win2008
(
1
)
Win7
(
29
)
WinAPI
(
1
)
Winform
(
1
)
WinXP
(
3
)
XML
(
1
)
FDZ Keyword Hightlight
標籤:
userscript
FDZ Title Keyword Hightlight,加入下列兩項功能
- 整合FDZ Article Link Clean
- 支援hightlight作者名
// ==UserScript==
// @name FDZ Keyword Hightlight
// @description 自動高亮文章標題關鍵字
// @author NKid
// @version 2011-04-24
// @run-at document-end
// @include http://forum.fdzone.org/forumdisplay.php?fid=*
// @include http://forum.*.fdzone.org/forumdisplay.php?fid=*
// ==/UserScript==
GM_registerMenuCommand('FDZ Keyword Hightlight - Setting Keywords', settingKeywords);
GM_registerMenuCommand('FDZ Keyword Hightlight - Keywords List', listKeywords);
GM_registerMenuCommand('FDZ Keyword Hightlight - Setting Authors', settingAuthors);
GM_registerMenuCommand('FDZ Keyword Hightlight - Authors List', listAuthors);
GM_registerMenuCommand('FDZ Keyword Hightlight - Open Link in New Tab', openNewTab);
//GM_registerMenuCommand('FDZ Title Find RegExp - DEL', DEL);
GM_addStyle('.GM_gotit {color:#000;background-color:#FBED73;-moz-border-radius:3px;padding:0 2px;}'); //Highlight Keyword Style
GM_addStyle('#GM_newtab {-moz-border-radius: 3px; color: #000000; cursor: pointer; font-size: 10px; height: 10px; position: fixed; right: 3px; top: 3px; width: 10px;} .GM_newtabOn {background-color: #00FF00} .GM_newtabOff {background-color: #FF0000}'); //NewTab State
/*function DEL() {GM_deleteValue("keywords");}*/
var tar=GM_getValue('newtab'); //new tab state
//setting Keywords
function settingKeywords() {
var KWs = (decodeURI(GM_getValue("keywords")) == 'undefined') ? '' : decodeURI(GM_getValue("keywords"));
var newKWs = prompt('Please Enter the Keywords.\n(use commas to separate)', KWs).split(',');
newKWs.sort(descStrLen);
GM_setValue("keywords", encodeURI(newKWs.join()));
refreshPage();
}
//list Keywords
function listKeywords() {
var listKWs = decodeURI(GM_getValue("keywords")).split(',');
alert(listKWs.join('\n'));
}
//setting Authors
function settingAuthors() {
var ARs = (decodeURI(GM_getValue("authors")) == 'undefined') ? '' : decodeURI(GM_getValue("authors"));
var newARs = prompt('Please Enter Authors\' names.\n(use commas to separate)', ARs).split(',');
newARs.sort(descStrLen);
GM_setValue("authors", encodeURI(newARs.join()));
refreshPage();
}
//list Authors
function listAuthors() {
var listARs = decodeURI(GM_getValue("authors")).split(',');
alert(listARs.join('\n'));
}
//Open articles in new tab
function openNewTab() {
GM_setValue("newtab", confirm("Open articles in new tab?"));
refreshPage();
}
//sort function (by string length)
function descStrLen(a, b) {
if (a.length < b.length) return 1;
}
//Message Refresh Page
function refreshPage() {
alert('Please Refresh Page.');
}
function toRegExpArray(oriArray) {
//把關鍵字array轉換成RegExp Array
var reArray = new Array(); //RegExp Array
for (var i = 0; i < oriArray.length; i++) {
reArray.push(new RegExp('(' + oriArray[i] + ')','ig'));
}
return reArray;
}
function main() {
//文章標題、描述
var KWs = decodeURI(GM_getValue('keywords')).split(','); //keywords array
var titles = document.querySelectorAll('span[id^=thread_]'); //all articles' title
var descs=document.querySelectorAll("[id^='desc_']"); //all articles' description
//作者
var ARs = decodeURI(GM_getValue('authors')).split(','); //authors array
var authors=document.querySelectorAll('.author > cite > a'); //all authors
//轉換RegExp Array
var reKWs=toRegExpArray(KWs);
var reARs=toRegExpArray(ARs);
//比對關鍵字
var i, j, titleStr, descStr,authorStr;
for (i = 0; i < titles.length; i++) {
//取出文章標題超連結的文字
titleStr = titles[i].childNodes[0].innerHTML;
//比對關鍵字
for (j = 0; j < reKWs.length; j++) {
if (reKWs[j].test(titleStr)) titleStr = titleStr.replace(reKWs[j], '<span class=\"GM_gotit\">$1</span>');
}
titles[i].childNodes[0].innerHTML = titleStr;
titles[i].childNodes[0].target=(tar)?"_blank":"";
titles[i].childNodes[0].href=titles[i].childNodes[0].href.replace(/&i.*/i,''); //FDZ Article Link Clean
}
for (i = 0; i< descs.length; i++) {
//取出文章描述的文字
descStr = descs[i].innerHTML;
//比對關鍵字
for (j = 0; j < reKWs.length; j++)
if (reKWs[j].test(descStr)) descStr = descStr.replace(reKWs[j], '<span class=\"GM_gotit\">$1</span>');
descs[i].innerHTML = descStr;
}
for (i = 0; i< authors.length; i++) {
//取出文章描述的文字
authorStr = authors[i].innerHTML;
//比對關鍵字
for (j = 0; j < reARs.length; j++) {
if (reARs[j].test(authorStr)) authorStr = authorStr.replace(reARs[j], '<span class=\"GM_gotit\">$1</span>');
}
authors[i].innerHTML = authorStr;
}
}
function newtab() {
var newtabState = document.createElement("div");
newtabState.id="GM_newtab";
newtabState.title="Open articles in newtab ?";
newtabState.className=(tar)?"GM_newtabOn":"GM_newtabOff";
document.getElementsByTagName("body")[0].appendChild(newtabState);
document.getElementById('GM_newtab').addEventListener('click',function(){GM_setValue("newtab", 1-GM_getValue("newtab")); refreshPage(); },false);
}
main();
newtab();
整理索引、回收已刪除空間
When a large amount of data is deleted from the database file it leaves behind empty space, or "free" database pages. This means the database file might be larger than strictly necessary. Running VACUUM to rebuild the database reclaims this space and reduces the size of the database file.
SQLite Query Language: VACUUM
Mozilla Links 正體中文版: Firefox 3 日漸肥大的收藏庫:減肥法
Vacuum the Stylish SQLite DB - forum.userstyles.org
for %%i in (*.sqlite) do sqlite3 %%i VACUUM | echo %%i
FORFILES /M *.sqlite /S /C "cmd /c sqlite3.exe @file VACUUM | ECHO @file"
SQLite Query Language: VACUUM
Mozilla Links 正體中文版: Firefox 3 日漸肥大的收藏庫:減肥法
Vacuum the Stylish SQLite DB - forum.userstyles.org
Get Lotto Win Num
標籤:
userscript
// ==UserScript==
// @name Get Lotto Win Num
// @description Get Lotto Win Num
// @include http://www.taiwanlottery.com.tw/Lotto/Lotto649/history.aspx
// ==/UserScript==
var n=document.querySelectorAll('div > span[id*="_No"]');
var winNumStr='';
for(var i=0;i<n.length;i++)
{
winNumStr+=n[i].innerHTML + " ";
if((i+1) % 7 == 0) winNumStr+="\n";
}
alert(winNumStr);
FDZ Encrypt Promotion
標籤:
userscript
// ==UserScript==
// @name FDZ Encrypt Promotion
// @description 加強解密推廣功能,自動轉址
// @include http://forum.*.fdzone.org/encryname.php?uid=*
// @include http://forum.fdzone.org/encryname.php?uid=*
// @include http://pro.fdzone.org/encryname.php?uid=*
// ==/UserScript==
location.assign("space.php?action=viewpro&uid=" + location.search.replace(/\?uid=/i,""));
Blogger "I wish to continue"
標籤:
userscript
因為Same Origin Policy,所以在cross-domain存取會產生"Permission denied to get property"問題,先轉址至iframe,再進行存取。
Scripting Iframes - Tutorial and Examples
Why is this javascript getting permission denied? - Stack Overflow
// ==UserScript==
// @name Blogger "I wish to continue"
// @description Blogger "I wish to continue"
// @author NKid
// @version 2011-12-10
// @include http://www.blogger.com/blogin.g?blogspotURL=*
// ==/UserScript==
if (document.querySelector('iframe'))
location.assign(document.getElementById('injected-iframe').src);
else
location.assign(document.querySelector('.kd-button-bar a:nth-child(1)').href);
Scripting Iframes - Tutorial and Examples
Why is this javascript getting permission denied? - Stack Overflow
取得IP
Note:不同的OS,需更改IPv4此字串
command - Batch: get IP address - Stack Overflow
@ECHO OFF
for /f "tokens=1-2 delims=:" %%a in ('ipconfig^|find "IPv4"') do set ip=%%b
SET IP=%IP:~1%
ECHO %IP%
TIMEOUT 5
command - Batch: get IP address - Stack Overflow
關閉自動更新後不自動重開機延期視窗
標籤:
Win7
- gpedit.msc
- 電腦設定 → 系統管理範本 → Windows元件 → Windows Update
- 有使用者登入時不自動重新開機以完成排定的自動更新安裝 → 已啟用
M01 Gallery List View
標籤:
userscript
- 自動展開貼圖,並條列顯示
- 除第一頁之外,皆自動移除圖片區塊
2011-04-09 加入頁碼判斷
2011-04-09 基本架構完成
// ==UserScript==
// @name M01 Gallery List View
// @description M01 Gallery List View
// @version 2011-04-09
// @include http://www.mobile01.com/gallerydetail.php*
// @include https://www.mobile01.com/gallerydetail.php*
// ==/UserScript==
var pageIndex = parseInt(location.search.replace(/\?.*&p=(\d+)/,'$1'),10);
var gallery = document.getElementById('gallery_tl');
var gContent=document.getElementsByClassName('gallery_content')[0];
if (pageIndex >1)
gallery.parentNode.removeChild(gallery);
else
{
var imgs=gallery.querySelectorAll('img');
var tmp='<img src="@src" /><br />';
var newHTML='';
for(var i=0;i<imgs.length;i++)
newHTML+=tmp.replace('@src',imgs[i].src).replace('thumb','mobile01');
gallery.innerHTML=newHTML;
}
gContent.parentNode.removeChild(gContent);
Node.removeChild()
標籤:
DOM
,
JavaScript
var gContent=document.getElementsByClassName('gallery_content')[0];
gContent.parentNode.removeChild(gContent);
Node.removeChild - MDC Doc Center
ReSize Imgs (AutoScale)
標籤:
Bookmarklet
javascript:
(function(){
var img=document.getElementsByTagName('img');
var MaxWidth=window.outerWidth*0.75;
var MaxHeight=800;
for(i=0;i<img.length;i++){
var HeightWidth=img[i].offsetHeight/img[i].offsetWidth;
var WidthHeight=img[i].offsetWidth/img[i].offsetHeight;
if(img[i].offsetWidth>MaxWidth){
img[i].width=MaxWidth;
img[i].height=MaxWidth*HeightWidth;
}
if(img[i].offsetHeight>MaxHeight){
img[i].height=MaxHeight;
img[i].width=MaxHeight*WidthHeight;
}
}
}
)()
ReSize Imgs (AutoScale)
訂閱:
文章
(
Atom
)