Skip to content

Instantly share code, notes, and snippets.

View Rainyan's full-sized avatar
💭
I may be slow to respond.

Rain Rainyan

💭
I may be slow to respond.
  • Finland
  • 06:59 (UTC +03:00)
View GitHub Profile
@Rainyan
Rainyan / autohotkey.ahk
Last active May 9, 2024 13:15
My AutoHotkey stuff
; Ripcord doesn't have mouse binds yet, so use F24 redirection as the mic mouse bind.
#HotIf WinExist("ahk_exe Ripcord.exe")
*$~xButton1::F24 ; don't block the mouse action, just replicate as a function key
#HotIf
; Disable left Windows key when inside CS to avoid mispresses
#HotIf WinActive("ahk_exe cs2.exe")
~LWin::vkFF ; only block plain key press, ie. still allow Win+key combos
#HotIf
@Rainyan
Rainyan / old-reddit.user.js
Last active May 3, 2024 10:12
UserScript to always redirect to old reddit style, without relying on cookies. Another userscript recommended for fixing old.reddit URLs: https://gist.github.com/Rainyan/0fdf3d449404fb786ea1a29589608ce5/
// ==UserScript==
// @name Always use old Reddit style
// @description Convert www.reddit urls into old.reddit urls on page load start. This can be useful if you often clear your cookies but want this setting to persist.
// @version 1.5.2
// @namespace redditAlwaysOldStyle
// @updateURL https://gist.githubusercontent.com/Rainyan/fbb1ff337eac3e6c604d9a6eee7badda/raw/
// @include https://www.reddit.com/*
// @exclude https://www.reddit.com/gallery/*
// @exclude https://www.reddit.com/login/*
// @exclude https://www.reddit.com/media?*
@Rainyan
Rainyan / public_code_signing_key.asc
Last active March 31, 2024 13:30
old, revoked as of 31/03/2024
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGWVem8BEADlPQ/DDdGYruPvlVecaG7wEjs4xrpmNVUzNUUfiMMAp9EeY/CI
NV5nxDEYzu2DHbo6pcitS+rWDH4H82zUa69xIZ6W+ulIxfWgLm/phu9taoEmfMtz
4ZzybOaTayH+sydk80pHTpQr1YPDzDxbS+zBKWM8XhECFf0gxIAWydUBbKT8Xi2O
abBJywmpUcuinw3AI6OydsEWLWabEM7jyw8dZmGqOn6GFyXSXV20cp+stWCvj0++
V/9NDEnJSR9bvCw3FcM4B4vQYMM+XpPAc1CooLZva12RPVtO1jTZuqri1cCbfkEv
2NWWRrlWWowgkrQjYYT02ZmqjwfCXjaqpKJcoIJCIoSlynkeEASMqnlznLhC62O2
CeBhlFAAcuoNPNLjBcx4OL75uPQjPA8Ly900VuYdaBdmtpMFWzyqhgCzcDRY3ufT
0ZWsCJqE6Vi/ZT8XfQHehLCQNwkgHpJ7X75MEyk4vgenvJCVODa8fuk6lzxyIi/6
@Rainyan
Rainyan / killcs.ahk
Last active December 23, 2023 18:08
AutoHotkey hotkey for killing cs2, for recovering from GPU driver failures without needing a restart. Press CTRL+P to activate.
; THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
; INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
; PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
; List of apps to kill on hotkey
^p::
Process,Close,cs2.exe
@Rainyan
Rainyan / yt-dehyperlink-chat.user.js
Last active October 27, 2023 10:18
For YouTube A/B testing victims. Removes the unhelpful clickable fake links, when trying to highlight text in YT live stream chat.
@Rainyan
Rainyan / input.conf
Last active October 19, 2023 21:30
mpv configs. "~/.config/mpv/", "%appdata%\mpv".
# Undo 981a9372
WHEEL_UP seek 10
WHEEL_DOWN seek -10
WHEEL_LEFT add volume -2
WHEEL_RIGHT add volume 2
# Increase/decrease subtitle font size
HOME add sub-scale +0.1
END add sub-scale -0.1
@Rainyan
Rainyan / gh_disable_shortcuts.user.js
Last active July 18, 2023 16:15
Make the GitHub web interface usable by turning off all its forced keyboard shortcuts that are interfering with browser and OS shortcuts.
// ==UserScript==
// @name Disable all GitHub shortcut keys
// @description Make the GitHub web interface usable by turning off all its forced keyboard shortcuts that are interfering with browser and OS shortcuts.
// @version 0.3.0
// @namespace githubPls
// @include https://github.com/*
// @updateURL https://gist.githubusercontent.com/Rainyan/bdc81d2280936e26ac8690e7ac1292f9/raw/
// ==/UserScript==
const ALLOWED_KEYS = [
@Rainyan
Rainyan / files_of_dir.sp
Created June 21, 2023 00:30
Get files of a directory as DataPack for SourceMod
// For path "dir_path", get files that match the "filter_by_extension" filter,
// and pass them by reference to a valid DataPack "out_datapack".
// Optionally supports SM's OpenDirectory parameters.
// Returns the number of files passed by reference.
// Caller is responsible for initializing and freeing the DataPack memory.
int GetFilesOfDir(const char[] dir_path, DataPack out_datapack,
const char[] filter_by_extension="",
bool use_valve_fs=false, const char[] valve_path_id="GAME")
{
int num_files_found = 0;
@Rainyan
Rainyan / macros.doskey
Last active June 4, 2023 18:16
Some doskey macros for limited aliasing-like behaviour on Windows. https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/doskey
;= Some doskey macros for limited aliasing-like behaviour on Windows.
;=
;= To install, drop this file into %USERPROFILE%\.config\macros.doskey, and run:
;= reg add "HKCU\Software\Microsoft\Command Processor" /v Autorun /d "DOSKEY /MACROFILE=\"%USERPROFILE%\.config\macros.doskey\"" /f
;=
;= Be sure to check the doskey docs before relying on this for complex stuff,
;= as there are some nonobvious ways in which more complex commands can fail:
;= https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/doskey
;= Extract audio from a media url using yt-dlp.
@Rainyan
Rainyan / prac.cfg
Last active May 25, 2023 16:00
CS:GO binds, etc. configs
// CSGO practice config
// 60 minutes time, buy anywhere, no bots.
// Restart the game if it's in incorrect game mode.
// TODO: how to reset game mode/type?
sv_full_alltalk 1
mp_roundtime_defuse 60
bot_kick