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
# Measures the average execution time of a specified function over a given number of iterations | |
export def main [ | |
func: closure # The function (closure) to be executed | |
iterations: int = 10000 # Number of iterations to run the function | |
] { | |
let start_time = date now | |
1..($iterations) | each { |_| do $func } | ignore | |
let end_time = date now |
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
from pathlib import Path | |
def get_env_data_as_dict(path: Path | str) -> dict[str, str]: | |
with open(path, "r") as f: | |
return dict( | |
list(map(str.strip, line.replace("\n", "").split("="))) | |
for line in f.readlines() | |
if not line.startswith("#") | |
) |
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 Twitch Chat Answer Inserter | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Inserts single words from Twitch chat into specified websites | |
// @author MrPandir | |
// @match https://slovo.win/* | |
// @updateURL https://gist.githubusercontent.com/MrPandir/f3d2b2c3c2fca98ac0fd4052288c2917/raw/chat-to-input.js | |
// @downloadURL https://gist.githubusercontent.com/MrPandir/f3d2b2c3c2fca98ac0fd4052288c2917/raw/chat-to-input.js | |
// @grant none |
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
use std "path add" | |
def cache [] { | |
let func = $in | |
let version = version | get version | |
let path = $nu.temp-path | path join "carapace-cache" $version | |
try { | |
open $path |