Skip to content

Instantly share code, notes, and snippets.

View elPytel's full-sized avatar

Jaroslav Körner elPytel

View GitHub Profile
@elPytel
elPytel / pdf_merger.py
Created April 21, 2023 13:31
Simple python script for merging .PDF files.
# By Pytel & Copilot
"""
Tento program slouží k sloučení PDF souborů do jednoho.
Použití:
python main.py -f "./PDFs" -o "merged.pdf"
Parametry:
-f --folder složka s PDF soubory
-o --output výstupní soubor
@elPytel
elPytel / sentient_regex.py
Created February 3, 2023 14:36
s/[Aa]re\s[Yy]ou\s\(.*\)?/Indeed, I am \1./
# By Pytel & Copilot
"""
Tento program načte vstup od uživatele a upraví pomocí regulárního výrazu.
Vzorový vstup:
"Are you sentient?"
Vzorový výstup:
"Indeed, I am sentient."
Vzorový vstup:
@elPytel
elPytel / Makefile
Created January 19, 2023 15:58
Intermediate Makefile
CC=clang
CFLAGS+= -Wall -Werror -std=gnu99 -g # -Werror -v -std=c99
LFLAGS= -lm
CFLAGS+=$(shell sdl2-config --cflags)
LDFLAGS+=$(shell sdl2-config --libs)
NAME=my_app
APP=my_app
BINARIES=main
@elPytel
elPytel / Makefile
Created January 19, 2023 15:52
Simple Makefile
TARGET = app
CC = clang
LIBS = -lm
CFLAGS = -g -Wall
.PHONY: default all clean
default: $(TARGET)
all: default
@elPytel
elPytel / autorun.sh
Created November 12, 2022 13:53
Script for auto-runing file on change.
#!/bin/bash
if [[ $# -eq 0 ]]; then
echo -e "$ERROR$: no file is specified!"
exit 1
fi
file="$1"
chmod +x $file &&
@elPytel
elPytel / printf.py
Created November 12, 2022 13:49
C like printf in Python
#!/usr/bin/python3
import sys
def printf(format, *args):
sys.stdout.write(format % args)
@elPytel
elPytel / install.sh
Created October 11, 2022 14:41
Python dependenci installation script
#!/bin/bash
# By Pytel
if [ -f requirements.txt ]; then
pip install -r requirements.txt
fi
@elPytel
elPytel / test.sh
Last active October 11, 2022 17:56
Python auto testing & coverage script
#!/bin/bash
# By Pytel
clear
coverage run -m py.test
coverage report -m
@elPytel
elPytel / crontab -e header
Created March 30, 2021 14:16
Cron-Tasks snippet
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │ 7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * * command_to_execute