-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New changes with randomQuestion #237
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
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9e1106a
New changes with randomQuestion
Shashank5665 e2abe6a
changes to randomQuestion button
Shashank5665 05a0559
created a seperate function to generate ramdom question Id.
Shashank5665 ccd724b
function name change
Shashank5665 8b4acdf
function name change
Shashank5665 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were you able to rebase off the
master
branch?url
is no longer used there and if we were to land this PR now, it wouldn't work! To rebase means to pull in the latest commits from the branch we're targeting, ie.master
, and then apply all of your commits in the order you made them. It can seem tricky if it's your first time doing it - let me know if you'd like for me to walk you through it 👍🏽Once you've rebased..
will need to be changed to..
and then we'll need to update
window.open()
as so:See questions.json here for how the data is presented - we no longer store the
https://leetcode.com/problems/
portion since we know that is "static" in a sense - we only store the unique identifying part of the address, aka a "slug" (MDN docs).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanprashad Yes, I am doing this for the first time, so can you please assist me😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I typed these commands till now, I am not sure what to do after this..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: I figured it out, I was able to successfully rebase the master branch, and new changes are now present in the master branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, seems like, after adding these changes..
There is a bug, the

questionSlug
isundefined
, because of which leetcode is not able to find the page.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you needed to pull from a different remote, ie. the
master
branch fromseanprashad/leetcode-patterns
instead ofmaster
fromShashank5665/leetcode-patterns
.We can see the remote repos you have via
git remote -v
:As you can see above, I only have remote for the original repo (ie. the one you're submitting a PR to). You'll need to run the following to add mine as an "upstream" remote:
Afterwards, you can verify we've correctly added my repo as a remote via
git remote -v
.I think you can then run the following to pull the latest
master
branch fromseanprashad/leetcode-patterns
(which has theslug
changes):Note that we'll need to force push after rebasing - this is because commit hashes change after rebasing, even though the contents of our commit doesn't!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @seanprashad, done with all the steps that you have mentioned, it took me a while to know what's going on, but surfing google a lil bit and with the help of your instructions, I have done it. Now, after starting the server, the feature works very well😁( with the slug inclusion ). I think everything is in place, So, is it just a pull request now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Please do mark it as a PR and I'll review it when I get a chance!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure @seanprashad !!