This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Google Drive API test | |
#NoEnv | |
SetWorkingDir %A_ScriptDir% | |
SetBatchLines, -1 | |
; http://www.howtosolvenow.com/how-to-create-your-google-drive-api-keys/ | |
; http://www.howtosolvenow.com/how-to-get-refresh-token-for-google-drive-api/ | |
client_id := "xxxxxxxxxxx" | |
client_secret := "xxxxxxxxxxx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto('https://gist.github.com/tmplinshi/b13952a5566ef3b5f05c7e03452002f1'); | |
await page.waitForSelector('#gist-share-url'); | |
const element = await page.$('#gist-share-url'); | |
await element.focus(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Include <Gdip_All> | |
MsgBox, % link := Imgur_UploadFromClipboard("Your_Client_ID") | |
Run, % link | |
Imgur_UploadFromClipboard(ClientID) { | |
body := ClipImageToByteArray() | |
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1") | |
; whr.SetProxy(2, "localhost:1080") | |
whr.Open("POST", "https://api.imgur.com/3/image", "true") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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." | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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. | |
___________________________________________________________ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 监测正在使用的键盘或鼠标.ahk | |
; https://autohotkey.com/board/topic/21283-native-hid-support/?p=139818 | |
#NoEnv | |
; Disable this line if you're running from an editor that catches StdOut | |
; (like PSPad or SciTE.) | |
DllCall("AllocConsole") | |
OnMessage(0xFF, "WM_INPUT") |