Skip to content

Instantly share code, notes, and snippets.

View lucascompython's full-sized avatar
:octocat:
"I use Arch btw"

Lucas lucascompython

:octocat:
"I use Arch btw"
  • 18:03 (UTC +01:00)
View GitHub Profile
@lucascompython
lucascompython / atop.md
Last active March 19, 2023 19:07
Make a terminal show both information of your CPU and GPU!

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

Preview image

Code

As I said really simple!

#!/bin/sh
@lucascompython
lucascompython / pacsize.sh
Created June 5, 2022 21:03
Shell script (basically just awk) to view a list of the packages that use more space in your disk, PACMAN ONLY.
#!/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
@lucascompython
lucascompython / presence.py
Last active April 3, 2022 12:26
This is discord RPC (Rich Presence) that shows the world a pornhub activity
from pypresence import Presence
import time
client_id = "APP CLIENT"
RPC = Presence(client_id)
RPC.connect()
#https://www.youtube.com/watch?v=dQw4w9WgXcQ
@lucascompython
lucascompython / opencv resizer_watermark.py
Created March 21, 2022 20:53
This is a faster resizer that also applies an watermark image using opencv
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:
@lucascompython
lucascompython / typeracer-chear.js
Last active March 18, 2022 08:57
This is a very simple typeracer-cheat
/* ==== 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;
@lucascompython
lucascompython / base64toblob.js
Created February 25, 2022 21:58
This is a javascript function to convert a given base64 string to a blob.
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);
@lucascompython
lucascompython / resizer.py
Last active February 24, 2022 21:27
This is a very simple image resizer that keeps the aspect ratio.
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: