Skip to content

Instantly share code, notes, and snippets.

tmplinshi

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 pageNav.ahk
; https://www.autohotkey.com/boards/viewtopic.php?f=28&t=61347
; F8::pageNav("pre") ; 上一页
; F9::pageNav("next") ; 下一页
pageNav(cmd = "next") {
static js
if (!js)
{
js =
View KeypressOSD.ahk
; KeypressOSD.ahk
;--------------------------------------------------------------------------------------------------------------------------
; ChangeLog : v2.22 (2017-02-25) - Now pressing same combination keys continuously more than 2 times,
; for example press Ctrl+V 3 times, will displayed as "Ctrl + v (3)"
; v2.21 (2017-02-24) - Fixed LWin/RWin not poping up start menu
; v2.20 (2017-02-24) - Added displaying continuous-pressed combination keys.
; e.g.: With CTRL key held down, pressing K and U continuously will shown as "Ctrl + k, u"
; v2.10 (2017-01-22) - Added ShowStickyModKeyCount option
; v2.09 (2017-01-22) - Added ShowModifierKeyCount option
; v2.08 (2017-01-19) - Fixed a bug
View UploadToImgur.ahk
; Create Imgurl ClientID -- https://api.imgur.com/oauth2/addclient
UploadToImgur(FileName, ClientID = "fbf77ff49c42c8a") {
return UploadToImgur.DoIt(FileName, ClientID)
}
Class UploadToImgur {
DoIt(FileName, ClientID) {
postData := this.FileToStream(FileName)
View Class_WinRing0.ahk
/*
Change Log:
v1.12 (2017-01-18) - Fixed OnExit not exiting
v1.11 (2017-01-17) - Added an internal function Ensure_Admin_And_Compiled()
v1.10 (2015-10-22) - Added support for sending characters that needs to press {shift} key, such as "@" or "A".
v1.00 (2015-07-25)
Dependency files:
WinRing0_v1.3.1.19.zip -- https://drive.google.com/file/d/0B7yNOlCgfluzMTE2UFc2ZHp5Z1E/view?usp=sharing
View FindAddressBar.ahk
; js := "void(document.getElementById('keywords').value='Hello world 1')"
; ChromeRunJs(js)
ChromeRunJs(ByRef js) {
static addrBar
if !addrBar || !WinExist("ahk_id " addrBar.hWnd) {
if !addrBar := FindAddressBar() {
throw "FindAddressBar failed."
}
@tmplinshi
tmplinshi / auto_resize_example.ahk
Last active Sep 6, 2019
basic example of how to do auto sizing.
View auto_resize_example.ahk
Gui, +Resize
Gui, Add, Edit, w250 h100 vEditField
Gui, Add, Button, Section, Start
Gui, Add, Button, yS, Stop
Gui, Show, Center
Return
GuiSize:
if !initSize {
GuiControlGet, c1, Pos, EditField
View RegExReplaceF.ahk
; RegExReplaceF(Haystack, NeedleRegEx, FunctionName [, OutputVarCount := "", Limit := -1, StartingPosition := 1])
; Examples
/*
str := "a 100 b 200"
MsgBox % RegExReplaceF(str, "\d+" , "Add8") ; -> "a 108 b 208"
MsgBox % RegExReplaceF(str, "O)(\d+)", "Add5") ; -> "a 105 b 205"
MsgBox % RegExReplaceF(str, "O)(\d+)", Func("AddN").Bind(3)) ; -> "a 103 b 203"
Add8(match) {
View CreateFormData.ahk
/*
CreateFormData - Creates "multipart/form-data" for http post
https://www.autohotkey.com/boards/viewtopic.php?t=7647
Usage: CreateFormData(ByRef retData, ByRef retHeader, objParam)
retData - (out) Data used for HTTP POST.
retHeader - (out) Content-Type header used for HTTP POST.
objParam - (in) An object defines the form parameters.
View TrayIcon.ahk
; ----------------------------------------------------------------------------------------------------------------------
; Name ..........: TrayIcon library
; Description ...: Provide some useful functions to deal with Tray icons.
; AHK Version ...: AHK_L 1.1.13.01 x32/64 Unicode
; Original Author: Sean (http://goo.gl/dh0xIX) (http://www.autohotkey.com/forum/viewtopic.php?t=17314)
; Update Author .: Cyruz (http://ciroprincipe.info) (http://ahkscript.org/boards/viewtopic.php?f=6&t=1229)
; Mod Author ....: Fanatic Guru
; License .......: WTFPL - http://www.wtfpl.net/txt/copying/
; Version Date...: 2014 - 01 - 16
; Note ..........: Many people have updated Sean's original work including me but Cyruz's version seemed the most straight
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")
You can’t perform that action at this time.