Skip to content

Instantly share code, notes, and snippets.

View ErykDarnowski's full-sized avatar
🔧
Tinkering

Eryk Darnowski ErykDarnowski

🔧
Tinkering
View GitHub Profile
@ErykDarnowski
ErykDarnowski / README.md
Created November 24, 2024 22:06
`heif-convert` convert all `.heic` files to `.png`

This snippet will (in current dir):

  1. Convert all files of .heic / .HEIC extension to ones with .png.
  2. Remove all original .heic files.
find . -type f -iname '*.heic' -print0 | while IFS= read -r -d '' file; do heif-convert "$file" -f "png" && rm "$file"; done
@ErykDarnowski
ErykDarnowski / README.md
Last active October 28, 2024 20:21
USOS timetable block time calculator

USOS timetable block time calculator [Userscript]

A script that adds time of block next to it's start / end times in the timetable.

Instructions

  1. Install a Userscript browser extension
@ErykDarnowski
ErykDarnowski / README.md
Created September 15, 2024 16:39
USOS print list of course final grades to console

USOS print list of course final grades to console

This little script works for both ordinary and part time timetables + has a bunch of cool QoL features ;)
(It displays the nicer timetable under the original one)

Instructions

  1. Go to your courses page (for me its: https://usosweb.ansb.pl/kontroler.php?_action=dla_stud/studia/oceny/index)
  2. Open the browser Dev Tools F12
  3. Paste in the code:
@ErykDarnowski
ErykDarnowski / README.md
Last active June 24, 2024 23:03
USOS print list of courses to console

USOS print list of courses to console

This little script works for both ordinary and part time timetables + has a bunch of cool QoL features ;)
(It displays the nicer timetable under the original one)

Instructions

  1. Go to your courses page (for me its: https://usosweb.ansb.pl/kontroler.php?_action=dla_stud/studia/oceny/index)
  2. Open the browser Dev Tools F12
  3. Paste in the code:
@ErykDarnowski
ErykDarnowski / copy_diff.sh
Created April 16, 2024 17:17
Copy missing files from source to destination dir on Linux
#!/bin/bash
# THIS ONLY CHECK THE DIFF IN AMOUNT OF FILES, NOT ACTUAL CONTENT!!!
# Make sure the SRC path has more files than the DST.
SRC_PATH="/d/Games/SteamLibrary/steamapps/common/assettocorsa/content/cars"
DST_PATH="//192.168.1.5/home/Backupy/AC Content Manager/content/cars"
DIFF_RESULT=$(diff --brief "$DST_PATH" "$SRC_PATH" \
| sed --quiet "s~^Only in \($SRC_PATH\): \(.*\)~'\1\/\2'~p")
@ErykDarnowski
ErykDarnowski / README.md
Last active November 24, 2024 22:06
`ffmpeg` convert all files of extension to different extension

This snippet will (in current dir):

  1. Convert all files of $first_ext extension to ones with $second_ext.
  2. Remove all files with the $first_ext extension.
first_ext="webm"
second_ext="mp4"
for i in *.$first_ext; do ffmpeg -i "$i" "${i%.*}.$second_ext"; done; for i in *.$first_ext; do rm "$i"; done
@ErykDarnowski
ErykDarnowski / README.md
Last active October 28, 2024 20:30
USOS deadlines page date highlighter

USOS deadlines page date highlighter [Userscript]

A script that highlights single date deadlines that happend to fall on a weekend (for part time students) and deadlines that are longer than a 1 day.

*The regex in this script may not work due to how other Unis write their pages!!!

Instructions

  1. Install a Userscript browser extension
@ErykDarnowski
ErykDarnowski / download.js
Last active November 11, 2023 09:35
Download FB messenger chat / group chat to txt file (for PL language)
/* Releases
- 1.0.0 Initial
- 1.0.1 Remove '\n' between each msg
*/
const config = {
numbered: true, // whether to number the messages
yourResponsesMargin: 90, // amount of ' ' char
msgsSelector: '__fb-dark-mode x1n2onr6', // message block class (10.11.2023 for first open from right)
defaultChatEmoji: [ 'Gest kciuka w górę', '👍' ], // [string for default emoji ; what to replaec it with]
@ErykDarnowski
ErykDarnowski / README.md
Last active April 9, 2024 23:26
USOS timetable day date adder + format fixer [Userscript]

USOS timetable day date adder + format fixer [Userscript]

A script that adds dates to individual days in the USOS timetable + fixes formatting of the 2 dates on top.

Instructions

  1. Make sure you're using the HTML timetable!
  2. Install a Userscript browser extension
@ErykDarnowski
ErykDarnowski / README.md
Last active April 10, 2024 17:30
USOS nice timetable display / copy / download [UserScript]

USOS nice timetable display / copy / download

This little script works for both ordinary and part time timetables + has a bunch of cool QoL features ;)
(It displays the nicer timetable under the original one)

Instructions

  1. Make sure you're using the HTML timetable!
  2. Install a Userscript browser extension