Git Product home page Git Product logo

Comments (6)

TurtleCode84 avatar TurtleCode84 commented on June 14, 2024 4

That's interesting;

I was curious about this too, so I looked into the code and found the class definition for the Experience trophy, and it looks like it is based on your Github account age (certain numbers of years).

However, you should still be at least at "Junior Dev" if the code comments are correct:

export class AccountDurationTrophy extends Trophy {
constructor(score: number) {
const rankConditions = [
new RankCondition(
RANK.SSS,
"Seasoned Veteran",
70, // 20 years
),
new RankCondition(
RANK.SS,
"Grandmaster",
55, // 15 years
),
new RankCondition(
RANK.S,
"Master Dev",
40, // 10 years
),
new RankCondition(
RANK.AAA,
"Expert Dev",
28, // 7.5 years
),
new RankCondition(
RANK.AA,
"Experienced Dev",
18, // 5 years
),
new RankCondition(
RANK.A,
"Intermediate Dev",
11, // 3 years
),
new RankCondition(
RANK.B,
"Junior Dev",
6, // 1.5 years
),
new RankCondition(
RANK.C,
"Newbie",
2, // 0.5 year
),
];
super(score, rankConditions);
this.title = "Experience";
this.filterTitles = ["Experience", "Duration", "Since"];
// this.hidden = true;
}
}

So I'm not entirely sure what's happening in your case, since it seems to be working correctly on my own profile. Maybe another developer could shed some light on this?

from github-profile-trophy.

 avatar commented on June 14, 2024

Hope i was clear with my English

from github-profile-trophy.

 avatar commented on June 14, 2024

Yeah I got it, I joined github in 2022 dec, now its feb of 2024 around a year. So my ranking if 4, 0.5 year is 2 , thus my rank is four as I have been in github for a year. You were very helpful thank you.

: )

from github-profile-trophy.

TurtleCode84 avatar TurtleCode84 commented on June 14, 2024

Happy to help!

Took me a minute to wrap my mind around how the scoring calculations work 😅

But out of curiosity, I looked a bit deeper into how the account age score is calculated, and I may even want to propose a change to one of the threshold scores.

const durationTime = new Date().getTime() -
new Date(userActivity.createdAt).getTime();
const durationYear = new Date(durationTime).getUTCFullYear() - 1970;
const durationDays = Math.floor(
durationTime / (1000 * 60 * 60 * 24) / 100,
);

This code gets the number of milliseconds since the Github account was created, converts milliseconds to days, and then divides by 100, so the number in durationDays now actually represents "hundreds of days."

So in the class definition, which uses durationDays, each rank is assigned at a rounded account age (to the hundreds place), meaning the rank won't immediately reflect when the account is as old as the code comment says.

new RankCondition(
RANK.AAA,
"Expert Dev",
28, // 7.5 years
),

For example, a score of 28 actually means 2800 days, about 7.67 years (more than 7.5). Nearly all of threshold values are the closest whole number value to the correct number of days, adjusted. The only one I would change is that of Master Dev, because 37 gives a closer estimate to ten years than 40.

Fascinating stuff!

Yes, I spent time doing this. I have no regrets :)

from github-profile-trophy.

github-actions avatar github-actions commented on June 14, 2024

This issue is stale because it has been open for 30 days with no activity.

from github-profile-trophy.

github-actions avatar github-actions commented on June 14, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

from github-profile-trophy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.