Skip to content

Instantly share code, notes, and snippets.

View neoOpus's full-sized avatar

Anoir Ben Tanfous neoOpus

View GitHub Profile
@neoOpus
neoOpus / Automatically Close Tab Based on Page Text.user.js
Last active May 1, 2024 16:51 — forked from thefloodshark/.js
Tampermonkey Userscript - Automatically Close Tab Based on Page Text
// ==UserScript==
// @name Autoclose Tab
// @namespace Autoclose Tab
// @include *
// ==/UserScript==
// separate words or phrases with a comma
var blacklist = ["cactus", "finances", "put other text here"],
re = new RegExp(blacklist.join('|'), "i");
if (re.test(document.body.textContent)) {
@neoOpus
neoOpus / .ahk
Created October 20, 2021 09:06 — forked from thefloodshark/.ahk
Open List of URLs in New Tabs or Browser
#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.
; Array of URLs you want to open
urlA := ["https://example.com"
,"https://example2.com"
,"https://example3.com"
,"https://example4.com"]
@neoOpus
neoOpus / .ahk
Created October 20, 2021 09:07 — forked from thefloodshark/.ahk
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::
@neoOpus
neoOpus / .ahk
Created October 20, 2021 09:07 — forked from thefloodshark/.ahk
Alternative Tab Switching
^Left::
Send ^+{Tab}
return
^Right::
Send ^{Tab}
return
~#!x::Suspend
@neoOpus
neoOpus / .ahk
Created October 20, 2021 09:07 — forked from thefloodshark/.ahk
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}
@neoOpus
neoOpus / .ahk
Created October 20, 2021 09:07 — forked from thefloodshark/.ahk
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}youremail@example.com
~#!x::Suspend
@neoOpus
neoOpus / .ahk
Created October 20, 2021 09:08 — forked from thefloodshark/.ahk
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::
{
@neoOpus
neoOpus / .js
Created October 20, 2021 09:08 — forked from thefloodshark/.js
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);
@neoOpus
neoOpus / Autoclose-URL.user.js
Last active November 1, 2021 18:25 — forked from thefloodshark/.js
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;
// ==UserScript==
// @name Translator for Whatsapp
// @namespace http://tampermonkey.net/
// @homepage https://greasyfork.org/scripts/28218-translator-for-whatsapp
// @version 2.4.3
// @description Translator for Whatsapp web
// @author JedLiu modded as suggested by neoOpus
// @match https://web.whatsapp.com/*
// @run-at document-start
// @grant GM_setValue