Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block tmplinshi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View RestartNetwork.ahk
Restart "Local area connection" without admin privileges
Example: RestartNetwork("Local area connection")
If ConnectionName is omited, the adapter name that contains "Realtek PCIe" will be selected.
RestartNetwork(ConnectionName := "") {
oShell := ComObjCreate("Shell.Application")
View AHKHID - example_3 修改版.ahk
; AHKHID - example_3 修改版.ahk
/*! TheGood
AHKHID - An AHK implementation of the HID functions.
AHKHID Example 3
Last updated: August 22nd, 2010
Monitors the mouse movements and button state changes.
This is a good example showing how to use the RI_MOUSE flags of the member II_MSE_BUTTONFLAGS.
View 监测正在使用的键盘或鼠标.ahk
; 监测正在使用的键盘或鼠标.ahk
; Disable this line if you're running from an editor that catches StdOut
; (like PSPad or SciTE.)
OnMessage(0xFF, "WM_INPUT")
View DigestAuth.ahk
class DigestAuth
Build(username, password, method, uri, ByRef WWWAuthenticate) {
Loop, Parse, % "realm|qop|algorithm|nonce|opaque", |
RegExMatch(WWWAuthenticate, A_LoopField "=""?\K[^,""]+", %A_LoopField%)
cnonce := this.create_cnonce()
nonceCount := "00000001"
View Chrome_GetTabList.ahk
Chrome_GetTabList() {
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.Open("GET", "http://localhost:9222/json")
out := []
for i, tab in Jxon_Load(whr.ResponseText)
if (tab.type = "page")
out.push( {url: tab.url, title: tab.title} )
View mpv-test.ahk
Gui, Add, Text, x50 y50 w700 h500 HWNDhText,
Gui, Show, w800 h620
mpv := "D:\Program Files\mpv\mpv.exe"
Run, %mpv% --idle --input-ipc-server=\\.\pipe\mpvsocket --wid=%hText% ; Or --wid=%hGUI%
View AccViewer Source.ahk
; Accessible Info Viewer by jethrow
; Modified by tmplinshi (2018-10-11)
; - Display all 'State' and its constant name/value
; - Display constant name/value of 'Role'
; - Change hotkey from "Ctrl+/" to "Ctrl+F12"
; - Added 'HotTracking' checkbox
; - Increased GUI Size
View GetBitrate.ahk
GetBitrate(FileName) {
if !InStr(FileName, ":") {
FileName := A_WorkingDir "\" FileName
RegExMatch(FileName, "^(.*\\)(.*)$", m)
oShell := ComObjCreate("Shell.Application")
oFolder := oShell.Namespace(m1)
return oFolder.GetDetailsOf( oFolder.Parsename(m2), 28 )
View ArgsToObj.ahk
ArgsToObj - Convert command line parameters to object
Command line parameters:
-from gbk /to utf-8 /a /b --delete-top 2 --delete-end=5 in.txt out.txt
View ParseCmdline.ahk
ParseCmdline - parse command line to object
cmdline = "a test.ahk" -from gbk /to utf-8 /a /b --delete-top 2 --delete-end=5 "in file.txt" out.txt
o := ParseCmdline(cmdline)
MsgBox, % obj_print(o)
You can’t perform that action at this time.