A script that adds dates to individual days in the USOS timetable + fixes formatting of the 2 dates on top.
- Make sure you're using the HTML timetable!
- Install a Userscript browser extension
- Tampermonkey (I use this one)
- Violentmonkey
/* 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] |
A script that adds dates to individual days in the USOS timetable + fixes formatting of the 2 dates on top.
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)
/* | |
!!! 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 |
/* 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! |
/* 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 |
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.
Games
in their name, print their amount of children and sort the output by numberfind -type d -name "*Games*" -not -empty
This part of the command uses the find command to search for directories (-type d) that have "Games" in their name (-name "Games") and are not empty (-not -empty). The find command prints the path of each matching directory to the standard output.
-exec sh -c 'echo "{}: $(expr $(ls -l "{}" | wc -l) - 1)"' \;
This part of the command uses the -exec option of the find command to execute another command on each matching directory. The command to execute is enclosed in single quotes and has a placeholder {} for the directory name. The command ends with a semicolon, which is escaped with a backslash to prevent the shell from interpreting it.