Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature easter egg username replacements #196

Open
wants to merge 8 commits into
base: next
Choose a base branch
from

Conversation

falkecarlsen
Copy link
Member

Very similar to #155 but utilises the username-hider feature #182, so the replaced username is on-screen until the next user approaches. Therefore, more people should be able to see the replaced usernames.

Allowing the feature to trigger at another interval could make it more than a once-a-year occurrence. Each Friday, maybe?

The ordinary replacement 'xxxxxxxx' is replaced with '[username_hidden]' for clarity but mostly personal preference.

@@ -11,8 +11,8 @@ if (username_element.length > 0) {
var replaced_username = "[username_hidden]";
var date = new Date();
// Only do username memes on April Fools
if (date.getDate() === 1 && date.getMonth() + 1 === 4) {
const easter_egg_names = ["user", "admin", "root", "alan_turing", "hackerman", "hans_huttel"];
if (date.getDate() === 21 && date.getMonth() + 1 === 2) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my calendar, that is not the first of April :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙃 fixed in b41abee

@falkecarlsen
Copy link
Member Author

I suggest doing these replacements on every Friday as it otherwise likely won't ever be seen.

@falkecarlsen
Copy link
Member Author

Turns out that Math.random returns a range inclusive of 0 but exclusive of 1. This is fixed in 6c9171d.

@jenrik jenrik self-requested a review February 25, 2020 10:19
Copy link
Member

@jenrik jenrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6c9171d nice catch 😉

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Merging #196 (21bb9a3) into next (e581544) will not change coverage.
Report is 1 commits behind head on next.
The diff coverage is n/a.

❗ Current head 21bb9a3 differs from pull request most recent head 40c4528. Consider uploading reports for the commit 40c4528 to get more accurate results

@@           Coverage Diff           @@
##             next     #196   +/-   ##
=======================================
  Coverage   53.90%   53.90%           
=======================================
  Files          33       33           
  Lines        4508     4508           
  Branches      265      265           
=======================================
  Hits         2430     2430           
  Misses       2028     2028           
  Partials       50       50           

var replaced_username = "[brugernavn skjult]";
var date = new Date();
// Only do username replacements on Fridays
if (date.getDay() === 5) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (date.getDay() === 5) {
if (date.getMonth() === 3 && date.getDay() == 1) {

I think having it every friday will kill the joke, and would create a lot of confusion. Having it on april fools would make people confused but they'd be able to reason with it. Maybe extend the easter egg to the first monday after april fools to make sure it will go in effect

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having it once a year is too short of a timeframe for it to be noticed, as most fembers doesn't stay around to look at the replaced 'xxxxxxxx'.

The first Friday of every month (for example) gives ~4 days per semester for fembers to notice it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Falke

@atjn atjn mentioned this pull request Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants