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 / 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 February 17, 2024 16:37
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
@ErykDarnowski
ErykDarnowski / script.js
Last active November 5, 2023 18:44
USOS print out unique lesson names (part time)
/*
!!! THIS WAS JUST A PROTOTYPE, HERE IS THE MUCH BETTER, IMPROVED VERSION: !!!
https://gist.github.com/ErykDarnowski/fd08f94ca139b1f575d8e7205e2e3a90
*/
/* USOS print out unique lesson names (part time)
* !!!This was created for the part time timetable as it doesn't divide the lessons by days!!!
*
* 1. Open your uni's USOS page
* 2. Go to your lesson timetable
@ErykDarnowski
ErykDarnowski / script.js
Created September 30, 2023 17:35
Automatically download reddit post and all it's comments
/* Instructions
1. Click on a reddit post you're interested in.
2. Open the dev tools ('F12') go to the `Console` tab.
3. Copy & paste in the code bellow and press 'Enter'.
- Wait for the page to fully load
- Make sure any comments aren't folded (they shouldn't be if the page just loaded)
- Scroll to the bottom of the page to make sure all comments are loaded.
- If you've run this script once, you'll need to reload the page.
4. Enjoy!
@ErykDarnowski
ErykDarnowski / script.js
Last active September 30, 2023 17:31
Automatically download multiple images from a reddit post
/* How to use
1. Click on a reddit post with bunch of images.
2. Open the dev tools (<kbd>F12</kbd>) go to the `Console` tab.
3. Copy & paste in the code bellow and press <kbd>Enter</kbd>.
4. Click `Allow` on the multiple file download popup.
5. Enjoy!
*/
// https://dev.to/sbodi10/download-images-using-javascript-51a9
@ErykDarnowski
ErykDarnowski / README.md
Last active September 11, 2023 12:29
Rename all dirs that contain more than 1 file from `Emulator` to `Emulators` (without `rename` command)

Rename all dirs that contain more than 1 file from Emulator to Emulators (without rename command)

find -type d -name "*Emulator" -not -empty -not -path "*Games*" -exec sh -c 'echo "{}: $(ls "{}" | wc -l)"' \; | awk -F: '$2 > 1' | cut -d: -f1 | xargs -I {} sh -c 'mv "{}" "{}s"'

The command is composed of several parts, each separated by a pipe (|) symbol. The pipe symbol means that the output of the previous part is passed as the input to the next part.

@ErykDarnowski
ErykDarnowski / README.md
Last active January 4, 2024 11:17
Copy multiple lines of text in front of other multiple lines of text in Vim

Copy multiple lines of text in front of other multiple lines of text in Vim

  1. Prep the initial multiline by for instance adding padding (e.g. on the right side of numbers)
  2. Select the multiline text you would like to copy
    1. Go to the first line
    2. Enter visual block mode (Ctrl + v or q)
    3. Move to the last line
    4. Go to the end of the line (Shift + 4)
  3. Cut it (d)
  4. Paste the initial multiline text to target multiline text