Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request implements the features requested in #23 and #48. Buy adding a shuffle button to the top of the page that shuffles the currently displaying posts, feature request #48 is implemented. By allowing the user to adjust in the menu how many posts are shown after a shuffle, feature request #23 is implemented.
As an additional improvement, I add the ability to choose between using true randomness posts and unique randomness when shuffling a certain number of posts. True randomness shuffles the posts with a true random number generator, so each time the user presses the shuffle button, new random posts will appear. Unique randomness shuffles the posts using a seed so that it can guarantee that every time the user shuffles the posts, no post is shown twice before every other post in the set has been shown. This is nice when the user is shuffling many posts but only wants to see a few at a time so they do not keep getting repeats.
This pull request also adds some deferring to the post rendering. This is to provide the user with the first 100 posts immediately upon first page render and when changing settings that change the posts displayed. It is a simple solution, but if further performance optimizations need to be done later, the deferring logic is not hard to rip out and replace.