Skip to content

Instantly share code, notes, and snippets.

View tsaiid's full-sized avatar

I-Ta Tsai tsaiid

View GitHub Profile
javascript:(
function() {
document.querySelectorAll("input[name^='radiorated'][id$='_1']").forEach(function(r){
var c = r.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.firstChild.innerText;
if (c.match(/^(5|26|27)\./)) {
var r = r.parentNode.parentNode.childNodes[13].childNodes[0];
}
r.click();
});
var title = document.querySelectorAll(".breadcrumb a")[1].innerText;
$$("input[name^='radiorated'][id$='_1']").forEach(function(r){
var c = r.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.firstChild.innerText;
if (c.match(/^(5|26|27)\./)) {
var r = r.parentNode.parentNode.childNodes[13].childNodes[0];
}
r.click();
});
$$("textarea")[0].value = "了解" + $$(".breadcrumb a")[1].innerText;
$$("textarea")[1].value = "無";
@tsaiid
tsaiid / ShuttleProV2.ahk
Last active July 19, 2019 15:44
Intercept input from ShuttlePro V2 using AHKHID library, modified from dorfl68 at AHK forum (https://t.co/1LVRRmzzyB)
; 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
@tsaiid
tsaiid / vscode-win-keybindings.json
Created February 1, 2018 00:18
my vscode-win-keybindings.json
[
{
"key": "ctrl+a",
"command": "cursorHome",
"when": "editorTextFocus"
},
{
"key": "ctrl+e",
"command": "cursorEnd",
"when": "editorTextFocus"
; 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 January 19, 2018 10:07
Reorder selected text from the clipboard
; 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
<!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 January 4, 2018 01:14
Handle the global hotkey ^t from Helios
; 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
[
{
"keys": ["ctrl+e"],
"command": "move_to",
"args":
{
"to": "eol",
"extend": false
}
},