Skip to content

Instantly share code, notes, and snippets.

View thefloodshark's full-sized avatar

theFloodShark thefloodshark

View GitHub Profile
@thefloodshark
thefloodshark / .js
Created April 2, 2018 07:34
Tampermonkey UserScript - Automatic Tab Closer Based on Designated URL Text
// ==UserScript==
// @name Autoclose URL
// @namespace Autoclose URL
// @include *
// @grant window.close
// ==/UserScript==
function check_if_should_close(url) {
if (url.match(/rnoreward/))
return true;
@thefloodshark
thefloodshark / .js
Created April 2, 2018 07:36
Tampermonkey Userscript - Website Auto-Refresh Timer
// ==UserScript==
// @name Auto-Refresh
// @include https://www.example.com
// ==/UserScript==
//--- https://stackoverflow.com/questions/25484978/i-want-a-simple-greasemonkey-script-to-reload-the-page-every-minute
setTimeout(function(){ location.reload(); }, 20*1000);
@thefloodshark
thefloodshark / .js
Created April 2, 2018 07:41
Tampermonkey Userscript - Keybind Numbered Google Results Select
// ==UserScript==
// @name Google digits
// @include https://www.google.tld/*
// @run-at document-start
// ==/UserScript==
// only work on search pages with #q= &q= ?q=
if (location.href.match(/[#&?]q=/)) {
window.addEventListener('keydown', function(e) {
var digit = e.keyCode - 48;
@thefloodshark
thefloodshark / .ahk
Created April 2, 2018 09:57
Special Keys - Keybind Bodies of Text
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
~SC027 & SC028::
Send {Backspace}
clipboard = ; send this text to the clipboard:
(
@thefloodshark
thefloodshark / .ahk
Created April 2, 2018 09:58
Monitor Off
#z::
Sleep, 200
SendMessage,0x112,0xF170,2,,Program Manager
return
~#!x::Suspend
@thefloodshark
thefloodshark / .ahk
Created April 2, 2018 09:59
Highlight Google Search (CTRL+G)
~#!x::Suspend
SendMode Input
RegRead, OutputVar, HKEY_CLASSES_ROOT, http\shell\open\command
StringReplace, OutputVar, OutputVar,"
SplitPath, OutputVar,,OutDir,,OutNameNoExt, OutDrive
browser=%OutDir%\%OutNameNoExt%.exe
^g::
{
@thefloodshark
thefloodshark / .ahk
Created April 2, 2018 10:00
Keybind Enter Text
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
~x & c:: Send, {BS}[email protected]
~#!x::Suspend
@thefloodshark
thefloodshark / .ahk
Last active October 20, 2021 09:07
Left/Right Mouse Wheel Click Tab Switch
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Works on Chrome and Mozilla (untested on others)
; left (with paste then tab)
WheelLeft::
Send ^+{Tab}
@thefloodshark
thefloodshark / .ahk
Created April 2, 2018 10:34
Alternative Tab Switching
^Left::
Send ^+{Tab}
return
^Right::
Send ^{Tab}
return
~#!x::Suspend
@thefloodshark
thefloodshark / .ahk
Created April 2, 2018 10:39
Toggle Double-Click to Copy
Suspend, on
; Example #4: Detects when a key has been double-pressed (similar to double-click).
; KeyWait is used to stop the keyboard's auto-repeat feature from creating an unwanted
; double-press when you hold down the RControl key to modify another key. It does this by
; keeping the hotkey's thread running, which blocks the auto-repeats by relying upon
; #MaxThreadsPerHotkey being at its default setting of 1.
; Note: There is a more elaborate script to distinguish between single, double, and
; triple-presses at the bottom of the SetTimer page.
~LButton::