Skip to content

Instantly share code, notes, and snippets.

Avatar

I-Ta Tsai tsaiid

View GitHub Profile
@tsaiid
tsaiid / ShuttleProV2.ahk
Last active Jul 19, 2019
Intercept input from ShuttlePro V2 using AHKHID library, modified from dorfl68 at AHK forum (https://t.co/1LVRRmzzyB)
View ShuttleProV2.ahk
; Intercept input from ShuttlePro V2 using AHKHID library
; Author: dorfl68 at AHK forum
; https://autohotkey.com/board/topic/92213-shuttlepro2-simple-script/
; Modified by tsaiid
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force
View chexnet.md
@tsaiid
tsaiid / vscode-win-keybindings.json
Created Feb 1, 2018
my vscode-win-keybindings.json
View vscode-win-keybindings.json
[
{
"key": "ctrl+a",
"command": "cursorHome",
"when": "editorTextFocus"
},
{
"key": "ctrl+e",
"command": "cursorEnd",
"when": "editorTextFocus"
View copy-helios-report-into-notepad.ahk
; Copy Current Helios Report Into Notepad
CopyHeliosReportIntoNotepad() {
WinGet, hWnd, ID, Helios
If (hWnd) {
; parse exam info
infoText := Acc_Get("Name", "4.5.1.1", 0, "ahk_id " hWnd)
RegExMatch(infoText, "^\[.+\]\s+(\w+)/([^\s]+)\s+\[(.+?)\]\s+\[.+?\]\s+\[(.+?)/.+?\]\s+\[([\d-]+).+?\]", examInfo)
ptID := examInfo1
@tsaiid
tsaiid / reorder-selected-text.ahk
Last active Jan 19, 2018
Reorder selected text from the clipboard
View reorder-selected-text.ahk
; Reordering the selected text
ReorderSeletedText(deOrder = False, keepEmptyLine = False, itemChar = ""){
Clipboard := ""
SendEvent ^c
Sleep, 300
StringReplace, selectedText, Clipboard, `r`n, `n, All
StringRight, strRight, selectedText, 1
View black-background.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body {background: black;}
#closeBtn {
@tsaiid
tsaiid / fix-chrome-new-tab-in-helios.ahk
Created Jan 4, 2018
Handle the global hotkey ^t from Helios
View fix-chrome-new-tab-in-helios.ahk
; Need to handle the global hotkey ^t from Helios
^t::
If WinActive("ahk_class Chrome_WidgetWin_1") {
ControlSend, ,^t, ahk_class Chrome_WidgetWin_1
} else {
SendInput ^t
}
Return
View emmet.sublime-keymap
[
{
"keys": ["ctrl+e"],
"command": "move_to",
"args":
{
"to": "eol",
"extend": false
}
},
@tsaiid
tsaiid / cf-ddns.sh
Last active Oct 9, 2017 — forked from larrybolt/cf-ddns.sh
Automatically update your CloudFlare DNS record to the IP, Dynamic DNS for Cloudflare
View cf-ddns.sh
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Automatically update your CloudFlare DNS record to the IP, Dynamic DNS
# Can retrieve cloudflare Domain id and list zone's, because, lazy
# Place at:
# /usr/local/bin/cf-ddns.sh
@tsaiid
tsaiid / OpenInOsiriX.ahk
Last active Oct 7, 2017
Send retrieve-then-open request to OsiriX with a given accession number
View OpenInOsiriX.ahk
OpenInOsiriX(AccNo) {
osirixUrl = http://__OSIRIX_IP__:__OSIRIX_PORT__
serverName = __PACS_SERVER_NAME_SET_IN_OSIRIX__
requestXml =
(
<?xml version="1.0"?>
<methodCall>
<methodName>Retrieve</methodName>
<params>
<param>