Skip to content

Instantly share code, notes, and snippets.

View schuhwerk's full-sized avatar

Vitus Schuhwerk schuhwerk

View GitHub Profile
@schuhwerk
schuhwerk / Control Video Speed.js
Last active November 8, 2024 12:37
UserScript. Control Video Playback Speed with Keyboard.
// ==UserScript==
// @name Video Speed Control with Keyboard
// @description Decrease and increase HTML video playback speed with "," and ".". Remembers and applies speeds across page-loads.
// @version 2024-11-08
// @author Vitus Schuhwerk
// @license MIT
// @homepageURL https://gist.githubusercontent.com/schuhwerk/67fb4da50652681b857002e1ba2bf071
// @updateURL https://gist.githubusercontent.com/schuhwerk/67fb4da50652681b857002e1ba2bf071/raw
// @downloadURL https://gist.githubusercontent.com/schuhwerk/67fb4da50652681b857002e1ba2bf071/raw
// @grant GM_getValue
const stringToBool = (s: string) => (s.toString().match(/^(true|[1-9][0-9]*|[0-9]*[1-9]+|yes)$/i) ? true : false)
type levelNames = "emerg" | "alert" | "crit" | "error" | "warn" | "notice" | "info" | "debug"
type logLevel = {
name: levelNames
cb: CallableFunction
defaultEnabled: boolean
}
type callableNames = {
[K in levelNames]: CallableFunction
@lac5
lac5 / autotts.meta.js
Last active June 19, 2024 00:39
Automatically reads messages in a chatroom page. (i.e. Picarto, Twitch, Youtube, etc.)
// ==UserScript==
// @name Auto TTS
// @namespace larryc5
// @version 0.1
// @description Automatically reads messages in a chatroom page. (i.e. Picarto, Twitch, Youtube, etc.)
// @author Larry Costigan <[email protected]>
// @match https://picarto.tv/chatpopout/*/public
// @require https://code.jquery.com/jquery-latest.min.js
// @grant GM_setValue
// @grant GM_getValue
@darekkay
darekkay / intellij-monokai-theme.xml
Last active September 18, 2024 20:50
Monokai Theme for JetBrains IDEs (IntelliJ IDEA, Webstorm, PhpStorm, PyCharm etc.)
<scheme name="Eclectide Monokai" version="142" parent_scheme="Default">
<colors>
<option name="ADDED_LINES_COLOR" value="295622" />
<option name="ANNOTATIONS_COLOR" value="b2c0c6" />
<option name="CARET_COLOR" value="bbbbbb" />
<option name="CARET_ROW_COLOR" value="" />
<option name="CONSOLE_BACKGROUND_KEY" value="1c1c1c" />
<option name="FILESTATUS_ADDED" value="629755" />
<option name="FILESTATUS_DELETED" value="6c6c6c" />
<option name="FILESTATUS_IDEA_FILESTATUS_DELETED_FROM_FILE_SYSTEM" value="6c6c6c" />
@vpalos
vpalos / filter.js
Last active February 2, 2022 21:27
JS: A simple search function designed for filtering large lists of strings.
/**
* Demo: http://vpalos.com/sandbox/filter.js/
*
* A generic search algorithm designed for filtering (very) large lists of strings; when an input string
* contains all the parts (words or characters; whitespace is ignored) of the query, spread-out over the text
* then the string is considered to be a match. It works with the way internet browsers (e.g. Firefox, Google
* Chrome) filter address-bar suggestions on user input. It is also quite fast; on my i7 laptop, filtering
* 1) a list of ~23000 items takes around 50ms (yes, milliseconds!);
* 2) a list of ~1 million text items took under 1 second.
* It works both in NodeJS as well as in browser environments (so far I only tested FF and GC).