You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Golang実装のメモコマンド Big Sky :: golang でメモ専用コマンド「memo」作った。 GitHub - mattn/memo: 📓 Memo Life For You が便利だったので、雑にzsh補完を書きました。 _memo_options() { local -a __memo_options __memo_options=( '--help:show help' '-h:show help' '--version:print the version' '-v:print the version' ) _describe -t option "option" __memo_options } _memo_sub_commands() { local -a __memo_sub_commands __memo_sub_commands=( 'new:create
こんにちわ。寒いですね。ネタも財布も寒いと噂の mattn です。 突然ですが Perl で電卓作れと言われれば、どう作りますか? 構文木つくって、括弧とか対応して...うざったいですよね。 せっかく Windows には最初から電卓が入っているのですから、これ 使っちゃいましょう。 どうやるか... 電卓を起動して、ボタンを押しちゃえばいいのです。 Win32::API を使って FindWindow でウィンドウを探し、数字ボタンのウィンドウ探し、SendMessage でボタンクリックのイベントを送り、最後に GetWindowText でテキストを取得してしまえばいいのです。 Win32::API は各 DLL と関数名、引数シグネチャ、戻り値シグネチャを指定すればエクスポートされている関数が取り出せます。 use Win32::API; $function = Win32::AP
mattn/libcallex-vim · GitHub こんなリポジトリが作られたので十中八九僕のlibcall()の記事についてだろうと思い、見たら色々驚かされた。 まず引数の受け渡しにJSONを使っていること。この発想はなかった。 ちなみにsyslib.vimとかvimprocでは0xFFを引数の区切りとしたバイト列でやっている。 あとJavaScriptみたいにg:libcallexを名前空間として、関数を追加してるところ。 Vimスクリプトでこんなの見たことなかったので。 あと何よりさらっとインラインアセンブラが使われててふいた。 しかもそれにちゃんと理由があって、アセンブラを使うことによって引数が1個でもn個でも pushしてcallするという非常に簡潔なコードになっているということ。 前の記事で言ったみたいに何通りも呼び出しのためのコードを書かずに済んでる。libcallex
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く