TamperMonkey user script which improves user experience with Codewars (or at least tries to).
This piece of code is a Tampermonkey user script which provides small convenience features for the Codewars website.
You can get the script here.
- Install Tampermonkey extension for your browser,
- Copy&paste the script to your scripts library.
- You can copy content of code boxes into clipboard.
- "Spoiler" flags are visible all the time and do not dis/re-appear in a very annoying manner.
- Contents of "Solutions" and "Past solutions" views are displayed in tabs by language.
- Leaderboards: "Solved kata is default leaderboard (since "Overall" ranking does not measure anything useful). Also, leaderboards are automatically scrolled to show your score.
- Beta kata: uses Codwewars API to fetch and present breakdown of rank votes.
- Show attempted languages of a user in "Discourse" (see below).
- Show timestamps of solution groups.
- Show a toggle for raw markdown comments.
- Show notifications after ranking up on leaderboards.
I haven't checked.
- Yes.
- A race condition here or there.
- Selectors, hooks and listeners used are so inefficient that your local power plant probably doubles its coal consumption.
- You are allowed to use it, unless someone authoritative (CW staff?) says you can't.
- You can modify it ONLY IF your modifications are going to bring any improvement into the way it works, AND you are going to share improved version with CW community.
- You can send all your critical remarks to
/dev/null, unless it's something I could learn or otherwise benefit from - in such case, you can contact me on Codewars Discord server.
I am really sorry if this code hurts your eyes, brain, or feelings in any way, but I am not a professional HTML developer and each and every technique present here (JavaScript, jQuery, TamperMonkey, CW API) I've used for the first time.
- Codewars
- TamperMonkey
- StackOverflow
- jQuery
- notify.js
- Chart.js
When the feature is enabled, it's possible to view languages a user attempted the kata with, by clicking on "Attempted languages" link under discourse posts. If a language appears as stroke through, it means that a viewing user cannot see the solution becaue they didnt complete the kata in this language. If a language name is clickable, it means that a viewing user is eligible for viewing the solution and can use the link to change the current language to the clicked one, and use the "View solution" expandable panel to see the code of the most recent attempt.