Read password from txt file and auto extract RAR file

  1. 取得Part1 RAR檔名
  2. 取得解壓密碼檔名
  3. 讀取解壓密碼 (txt編碼為ANSI)
  4. 執行解壓縮

@ECHO OFF
REM 取得Part1 RAR檔名
FOR /f "delims=" %%a in ('DIR *.rar /oe /b') DO (
SET fisrtFileName=%%a
GOTO getPasswordFileName
)
:getPasswordFileName
REM 取得解壓密碼檔名
FOR /f "delims=" %%a in ('DIR *.txt /oe /b') DO (
SET passwordFileName=%%a
GOTO getPassword
)
:getPassword
REM 讀取解壓縮密碼
REM pw.txt編碼為ANSI
FOR /f "usebackq tokens=1" %%i in ("%passwordFileName%") DO (
SET rarPassword=%%i
GOTO extractFile
)
:extractFile
ECHO RarFileName:%fisrtFileName%
ECHO PwFileName:%passwordFileName%
ECHO Pw:%rarPassword:&=^&%
REM 執行解壓縮
"C:\Program Files\WinRAR\Rar.exe" -p"%rarPassword%" x %fisrtFileName%
FOR /f "delims=" %%a in ('DIR *.url /oe /b') DO (
SET urlFileName=%%a
GOTO renameJPG
)
:renameJPG
REM 重新命名封面
REN *.jpg %urlFileName:.url=%.jpg
PAUSE

檔案總管反向選取

在檔案總管裡,使用Win + A進行反向選取

#x::ExitApp
#IfWinActive ahk_class CabinetWClass
#A:: Send !ei ;編輯(E) → 反向選擇(I)

Middle Paste

  • 在Notepad2裡,按中鍵,每貼上三次,自動多換一行 
  • 在SMG主畫面,按中鍵,貼上下載碼
  • 在SMG新增下載檔案畫面,按中鍵,自動貼上剪貼簿內容且確定

#IfWinActive ahk_class Notepad2U
MButton::
Send ^v
Send {Enter}
L++
IF(L =3)
{
    Send {Enter}
    L=0
}
Return
#IfWinActive ahk_class TAddDownloads.UnicodeClass
MButton::
Send {TAB 6}
Send E:\%Clipboard%
Send {Enter}
Return
#IfWinActive ahk_class TMainForm.UnicodeClass
MButton::
Send {F4}
Return
In this paper:表明論文闡述了什麼觀點
In this study:表述在研究中做了什麼工作、獲得什麼成果
In this paper 與 In this study 的區別 - womendu - ITeye技術網站

Marquee 跑馬燈

var scrl='Test String';
function scrlsts() {
    scrl = scrl.substring(1, scrl.length) + scrl.substring(0, 1);
    document.title = scrl;
    setTimeout(scrlsts, 300);
}
scrlsts();

HTML Marquee

Shoudian Url Redirect

// ==UserScript==
// @name           shoudian URL Redirect
// @description    shoudian URL Redirect
// @include        http://www.shoudiancn.com/*
// @include        http://www.shoudian.org/*
// @include        http://shoudiancn.com/*
// ==/UserScript==
location.assign('http://www.shoudian.com' + location.pathname + location.search);

remove an inline onclick attribute

element.setAttribute ("onclick", null);
javascript - How can I remove an inline onclick attribute with a bookmarklet? - Stack Overflow

event.preventDefault

function stopDefAction(evt) {
  evt.preventDefault();
}

event.preventDefault - MDN Docs

event.target

function showTagName(e)
{
    alert(e.target.tagName);
    e.preventDefault();
}
window.addEventListener('click',showTagName,false);

event.target - MDN Docs