function inst() {
Array.from(document.getElementsByTagName("comp")).map(element => {
if (!element.hasAttributes()) return;
const func = element.attributes[0].name;
if (!/\w\(.*\)/.test(func)) return;
element.innerHTML = eval(func);
});
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Focus Search on Tab | |
| // @namespace http://tampermonkey.net/ | |
| // @version 1.0 | |
| // @description Focus the main search input when Tab is pressed | |
| // @match *://*/* | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### all of these bind the "print" key to take screenshots with slection area using scrot | |
| # use datetime as filename | |
| bindsym --release Print exec --no-startup-id scrot $HOME/Pictures/Screenshots/`date +%Y-%m-%d_%H:%M:%S`.png --select | |
| # ask for filename using dmenu and fall back to datetime if no name provided | |
| bindsym --release Print exec --no-startup-id $HOME/bin/take_screenshot.sh $HOME/Pictures/Screenshots | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| keycode 8 = | |
| keycode 9 = Escape NoSymbol Escape NoSymbol Escape | |
| keycode 10 = 1 exclam 1 exclam onesuperior exclamdown onesuperior exclamdown 1 exclam onesuperior exclamdown | |
| keycode 11 = 2 quotedbl twosuperior oneeighth twosuperior oneeighth twosuperior | |
| keycode 12 = 3 section threesuperior sterling threesuperior sterling threesuperior | |
| keycode 13 = 4 dollar 4 dollar onequarter currency onequarter currency 4 dollar onequarter currency | |
| keycode 14 = 5 percent 5 percent onehalf threeeighths onehalf threeeighths 5 percent onehalf threeeighths | |
| keycode 15 = 6 ampersand 6 ampersand notsign fiveeighths notsign fiveeighths 6 ampersand notsign fiveeighths | |
| keycode 16 = 7 slash braceleft seveneighths braceleft seveneighths | |
| keycode 17 = 8 parenleft bracketleft trademark bracketleft trademark |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # __ | |
| # ___ __ _____ ___ / / | |
| # (_-</ // (_-<_ (_-</ _ \ | |
| # /___/\_, /___(_)___/_//_/ | |
| # /___/ | |
| # | |
| # Jonn 2025 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function caseSensitiveOuterHTML(element) { | |
| if (element.nodeType === Node.TEXT_NODE) { | |
| return element.wholeText; | |
| } | |
| const tagName = element.tagName; | |
| let attributes = element.attributes; | |
| let children = [...element.childNodes]; | |
| if (children.length) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function isPrime(n) { | |
| if (n < 2) return false; | |
| let divisor = 2; | |
| while (divisor <= n / 2) { | |
| if (n % divisor === 0) return false; | |
| ++divisor; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Selecting an element | |
| const counterElement = document.querySelector("#counter"); | |
| // Creating a mutable (the "new" is unnecessary, just looks cool) | |
| const state = new Mutable({ | |
| count: 0 | |
| }); | |
| // Subscribing to it (update the content of our element, when mutable changes) | |
| state.$subscribe(() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This script transforms hex numbers in objects to hex-strings (for more elegant style-code) | |
| // The number-to-hex-string conversion | |
| const hex = num => `#${ num.toString(16) }` | |
| // Entries in objects that should be transformed | |
| const TRANSFORM_ENTRIES = [ | |
| "backgroundColor", | |
| "color" | |
| ]; |
NewerOlder