Skip to content

Instantly share code, notes, and snippets.

View 10sr's full-sized avatar
👀
I may be slow to respond.

10sr 10sr

👀
I may be slow to respond.
View GitHub Profile
@10sr
10sr / autohotkey.cfg
Created February 9, 2010 09:13
oedit/otbedit用のahkキーワードファイル
// language setttings for AutoHotKey
// 関数、機能が1、それ以外が2 な感じ
KeywordNocase:TRUE
KeywordFile:autohotkey.txt
OpenComment:/*
CloseComment:*/
RowComment:;
BreakChars: ,.:;(){}[]"=><-|&*+-/%!^
OperatorChars:=!&|^~*/+-%<>;:.,(){}[]
BracketChars:)}
@10sr
10sr / listallfiles.ahk
Created February 10, 2010 12:39
フォルダを受け取ってサブフォルダ含めファイルのリストを出すahk
rootdir = %1% ;例えば引数からとる
files =
SetWorkingDir, %rootdir%
Loop, *.* , 0 , 1
files = %files% "%A_LoopFileLongPath%" %A_Space% ;ここを変えれば区切りを変えれる。例えば`nとか
msgbox,%files% ;%files%に出力
@10sr
10sr / thispath.ahk
Created February 12, 2010 02:12
タイトルのパスで何かするAHK。精度いまいち
#NoTrayIcon
CoordMode,menu,active
SplitPath, A_AhkPath, ahkexename, ahkexedir,
;MouseGetPos, mousex, mousey, thiswin, thiscontrol
WinGetTitle, thistitle ,A ;アクティブのタイトルを取得
SplitPath, thistitle, thisfilename, thisdir ;ディレクトリとファイル名に分割
StringSplit, thisfilename , thisfilename, %A_Space% ;ファイル名の空白以降を除去
thispath = %thisdir%\%thisfilename1% ;フルパス
@10sr
10sr / indexdumper.ahk
Created February 16, 2010 16:22
ディレクトリのファイルリストを相対パスでindex.htmlに生成
#NoTrayIcon
p = %1%
if ( p = "-a" )
{
IfExist, %2% ;%2% exist
SetWorkingDir, %2%
else
{
goto dirnotfound
@10sr
10sr / xmpcontrol.ahk
Created February 23, 2010 05:39
xmplayコントローラ
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;前準備
#NoTrayIcon
CoordMode,menu,screen
SplitPath, A_LineFile, xmpc_scriptname, xmpc_scriptdir,
DetectHiddenWindows, on ;隠しウィンドウを見つける設定
WinGetTitle, xmptitle , ahk_class XMPLAY-MAIN
@10sr
10sr / winlist.ahk
Created March 3, 2010 17:41
開いてるウィンドウをメニューで一覧してアクティブにする。alt+tab代替みたいなもの。
/*
開いてるウィンドウをメニューで一覧してアクティブにする。alt+tab代替みたいなもの。
ifのとこを編集することで除外するものを指定可。
*/
Menu, winlistmenu , Add
Menu, winlistmenu , delete
WinGet, winlist , list ,,, title text which will not exist at %a_now%,
loop,%winlist%
@10sr
10sr / afxwrestart.ahk
Created April 10, 2010 15:38
あふリスタータ afxwrestart.exe AFX.EXE TAfxFormな感じ
if 0 = 0
{
msgbox,あふの実行ファイルと同フォルダに置く。`nあふ:`nafxwrestart.exe AFX.EXE TAfxForm`nあふw:`nafxwrestart.exe AFXW.EXE TAfxWForm
exitapp
}
IfWinNotExist, ahk_class %2%
exitapp
winclose
winwaitclose
@10sr
10sr / querythenengine.js
Created May 12, 2010 16:11
keysnailで文字入力→検索エンジン選択みたいな
plugins.options["search-url-list"] = [
["bing","http://bing.com/search?q=%q"],
["raw","%r"],
];
ext.add("query-then-engine", function () {
prompt.read("Search Word?:", function (q) {
if (q) {
prompt.selector({ message : "search \"" + q + "\" with?",
collection : plugins.options["search-url-list"],
@10sr
10sr / printdir.el
Created June 24, 2010 12:45
diredでミニバッファに現在行の内容表示
(defun dired-print-current-dir-and-file ()
(message (concat default-directory
" "
(buffer-substring-no-properties
(point-at-bol) (point-at-eol)))))
(defadvice dired-next-line (after dired-next-line-print-directory activate)
"print current directory when go down line"
(dired-print-current-dir-and-file))
(defadvice dired-previous-line (after dired-previous-line-print-directory activate)
"print current directory when go up line"
@10sr
10sr / keysnail-small-tweet.js
Created September 3, 2010 13:50
関数が外側にある
//////////////////////////////
// twitter
function tweetstatus(aInitialInput) {
var statusbar = document.getElementById("statusbar-display");
var limit = 140;
prompt.reader({
message: "tweet:",
initialcount: 0,
initialinput: aInitialInput,
group: "twitter_tweet",