ATOP (all top)
REALLY simple (4 lines) script that uses Tmux to split the terminal vertically and open nvtop to the left and btop to the right.
Preview
Code
As I said really simple!
lucascompython’s gists
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
| import polars as pl | |
| import argparse | |
| import sys | |
| from typing import List, Dict, Tuple | |
| def calculate_optimal_algorithm( | |
| csv_file: str, | |
| file_size_mb: float, | |
| upload_speed_mbps: float, | |
| download_speed_mbps: float = 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
| # Match Selection | |
| g-a -> select all match | |
| g-l -> select next match | |
| g-shit l -> select previous match | |
| g-l and then c -> select next match, remove the text and enter insert mode | |
| # Pane Spliting | |
| ctrl-w a -> split window | |
| ctrl-k down -> split window down |
REALLY simple (4 lines) script that uses Tmux to split the terminal vertically and open nvtop to the left and btop to the right.
As I said really simple!
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/sh | |
| pacman -Qi | awk $@ ' | |
| BEGIN { | |
| units["B"] = 0 | |
| units["KiB"] = 1 | |
| units["MiB"] = 2 | |
| units["GiB"] = 3 | |
| if (unit == "") unit = "MiB" | |
| if (min == "") min = 50 | |
| if (pad == "") pad = 10 |
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
| import cv2, os | |
| watermark = cv2.imread(os.path.join("watermark.jpg")) | |
| h_wtmk, w_wtmk = watermark.shape[:2] | |
| def resize(inpath: str, outpath: str, size: tuple = (768, 512), inter: int = cv2.INTER_AREA) -> 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
| /* ==== Typeracer Cheat ==== */ | |
| //Paste this script into the developer console right before the race start | |
| //Now you can press any key and it will enter the correct one | |
| var arrSpan = document.querySelectorAll('[unselectable="on"]'); | |
| var fullSentence = ''; | |
| arrSpan.forEach(function (item) { | |
| fullSentence += item.innerHTML; |
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
| const b64toBlob = (b64Data, contentType='', sliceSize=512) => { | |
| const byteCharacters = atob(b64Data); | |
| const byteArrays = []; | |
| for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) { | |
| const slice = byteCharacters.slice(offset, offset + sliceSize); | |
| const byteNumbers = new Array(slice.length); | |
| for (let i = 0; i < slice.length; i++) { | |
| byteNumbers[i] = slice.charCodeAt(i); |
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
| import os, sys | |
| from PIL import Image | |
| def rezise(dir, size: tuple = (768, 512)) -> None: | |
| for infile in os.listdir(dir): | |
| outfile = os.path.splitext(infile)[0] + "_resized.thumbnail" | |
| if infile != outfile: | |
| try: |