function inc(filename)
{
var body = document.getElementsByTagName('HEAD').item(0);
script = document.createElement('script');
script.src = filename;
script.type = 'text/javascript';
body.appendChild(script);
}
標籤
.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
)
include script
標籤:
DOM
,
JavaScript
Give Me Bigger
標籤:
userscript
學網連wretch速度很快,故開發此套件,方便逛相簿,搭配Website: cleaner - WRETCH使用,成效更佳。
// ==UserScript==
// @name Give Me Bigger
// @description 表格式顯示相簿原圖
// @priority 1
// @version 2011-05-17
// @include http://www.wretch.cc/album/album.php*
// @include http://*.pixnet.net/album/set/*
// @include http://photo.xuite.net/*/*
// ==/UserScript==
GM_registerMenuCommand('Give Me Bigger - Setting columns', settingColumns);
GM_registerMenuCommand('Give Me Bigger - Setting width of images', settingImgWidth);
var siteRule=['www.wretch.cc','pixnet.net','photo.xuite.net'];
var thumbRule=['thumbs\/t','thumb_','_c'];
var thumbRRule=['','','_l'];
var contentRule=['#ad_square','#contentBody','.list_area'];
var linkRule=['td.side a','.thumbImg a','.list_area .photo_info a'];
//Setting columns
function settingColumns() {
var oldCols=GM_getValue('cols')||2; //(Default Value:2)
GM_setValue('cols', prompt('Please enter the columns.', oldCols));
}
//Setting width of images
function settingImgWidth() {
var oldIW=GM_getValue('imgwidth')||240; //(Default Value:240)
GM_setValue('imgwidth', prompt('Please Enter the width(px) of images.', oldIW));
}
//Setting display infomation
function settingInfo() {
window.infoBlock=document.createElement('p');
infoBlock.style.position='absolute';
infoBlock.style.top='10px';
infoBlock.style.left='50px';
infoBlock.style.fontSize='1.8em';
window.curCount=document.createElement('span'); //Current complete images
curCount.textContent=0;
window.toaCount=document.createElement('span'); //Amount of all images
infoBlock.appendChild(curCount);
infoBlock.appendChild(toaCount);
document.getElementsByTagName('body')[0].appendChild(infoBlock);
window.oriTitle=document.title; //Save oringinal title
}
//Counting complete images
function imgReady(){
curCount.textContent=parseInt(curCount.textContent,10)+1;
document.title = curCount.textContent + toaCount.textContent;
}
//依據網址找出規則式編號
function chkIndex(){
for(var i=0;i<siteRule.length;i++)
if(location.href.indexOf(siteRule[i]) != -1) return i
}
function GMB() {
settingInfo();
var ruleIndex=chkIndex(); //規則式編號
var imgWidth=parseInt(GM_getValue('imgwidth')||240,10) //圖片寬度
GM_addStyle('.GMBtd img{max-width:@imgwidthpx}'.replace('@imgwidth',imgWidth));
var pics=document.querySelectorAll('img[src*="' + thumbRule[ruleIndex].replace('\\','') + '"]'); //全部縮圖
var picLinks=document.querySelectorAll(linkRule[ruleIndex]); //圖片超連結
var cols=parseInt(GM_getValue('cols')||3,10); //欄數
var intRows=Math.floor(pics.length / cols); //整數列
var leftPics=pics.length % cols; //剩餘圖片數
var patt=RegExp('(' + thumbRule[ruleIndex] + ')', 'i'); //原圖規則式
var htmlCode=[];
toaCount.textContent=' / ' + pics.length;
//先處理整數列
for(var i=0;i<intRows;i++)
{
htmlCode[htmlCode.length]='<tr>';
for(var j=0;j<cols;j++)
htmlCode[htmlCode.length]='<td class="GMBtd"><a target="_blank" href="' + picLinks[i*cols+j].href + '"><img src="'+ pics[i*cols+j].src.replace(patt,thumbRRule[ruleIndex])+'" /></a></td>';
htmlCode[htmlCode.length]='</tr>';
}
//再處理剩餘圖片
if(leftPics != 0)
{
htmlCode[htmlCode.length]='<tr>';
for(var k=0;k<leftPics;k++)
htmlCode[htmlCode.length]='<td class="GMBtd"><a target="_blank" href="' + picLinks[intRows*cols+k].href + '"><img src="'+ pics[intRows*cols+k].src.replace(patt,thumbRRule[ruleIndex])+'" /></a></td>';
htmlCode[htmlCode.length]='</tr>';
}
var tb=document.createElement('table');
tb.innerHTML=htmlCode.join('');
tb.id='GMB';
var oldContent=document.querySelector(contentRule[ruleIndex]);
oldContent.parentNode.replaceChild(tb,oldContent);
//綁定計算圖片完成數
var myPics=document.querySelectorAll('#GMB img');
for(var i=0;myPics[i];++i)
myPics[i].addEventListener('load',imgReady,false);
delete htmlCode;
delete pics;
delete picLinks;
}
window.addEventListener('DOMContentLoaded',GMB,false);
window.addEventListener('load',function() {document.title=oriTitle},false);
開啟、關閉雙螢幕
標籤:
VBScript
此script只適用於WinXP,Win7請使用快捷鍵(win + P)
開啟:
關閉:
開啟:
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,4");
WScript.Sleep(1000);
WshShell.SendKeys("{TAB}");
WshShell.SendKeys("{DOWN}");
WshShell.SendKeys("{TAB 4}");
WshShell.SendKeys("{ }");
//WshShell.SendKeys("%A");
WshShell.SendKeys("~");
關閉:
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,4");
WScript.Sleep(1000);
WshShell.SendKeys("{TAB}");
WshShell.SendKeys("{DOWN}");
WshShell.SendKeys("{TAB 5}");
WshShell.SendKeys(" ");
WshShell.SendKeys("~");
自動變更IP
判斷目前IP,且自動變更IP
@ECHO OFF
for /f "tokens=1-2 delims=:" %%a in ('ipconfig^|find "IPv4"') do set ip=%%b
SET IP=%IP:~1%
IF %IP% == 140.127.22.228 (
Set ip=140.127.22.219
) ELSE (
SET ip=140.127.22.228
)
netsh interface ip set address "區域連線" static %IP% 255.255.255.128 140.127.22.253
REM netsh interface ip set dns "區域連線" static 140.127.1.2
REM netsh interface ip add dns "區域連線" static 8.8.8.8
ECHO "Change IP => %IP%"
PAUSE
KISSRadio 網路音樂台
標籤:
userscript
// ==UserScript==
// @name KISSRadio 網路音樂台
// @description 顯示歌名於body、title
// @run-at document-end
// @author NKid
// @version 2011-08-02
// @include http://www.kiss.com.tw/marquee.php?id=308*
// ==/UserScript==
GM_addStyle('body {background-color:#262629} h1 {text-align:center; margin-top:10%; font-size:5em; color:white;}');
var songName=document.querySelector('td span').innerHTML.replace(/(正在播放|即將播放)<span style=\"font-size:3pt;\"> :<\/span>/,'');
var tb=document.getElementsByTagName('table')[0];
tb.parentNode.removeChild(tb);
document.getElementsByTagName('body')[0].innerHTML='<h1>'+ songName+'</h1>';
//document.title=songName;
setTimeout(function(){location.assign('http://www.kiss.com.tw/marquee.php?id=308' + '&t=' + new Date().getTime() );},30*1000);
function scrlsts() {
songName = songName.substring(1, songName.length) + songName.substring(0, 1);
document.title = songName;
setTimeout(scrlsts, 300);
}
scrlsts();
htmlmarquee - Title Marquee
取得年、月、日、時間
@echo off
echo %%date%%=%date%
echo 年 = %%date:~0,4%% = %date:~0,4%
echo 月 = %%date:~5,2%% = %date:~5,2%
echo 日 = %%date:~8,2%% = %date:~8,2%
echo:
echo %%time%%=%time%
set NowTime=%time: =0%
set hh=%NowTime:~0,2%
set mm=%NowTime:~3,2%
set ss=%NowTime:~6,2%
echo hh=%hh%
echo mm=%mm%
echo ss=%ss%
pause
@ECHO OFF
For /F "tokens=1-3 delims=/ " %%a IN ('DATE /t') DO (SET DATE=%%a-%%b-%%c)
SET NowTime=%time: =0%
ECHO %DATE%-%NowTime:~0,2%-%NowTime:~3,2%-%NowTime:~6,2%
PAUSE
Batch Get Date Time
訂閱:
文章
(
Atom
)