Coder Social home page Coder Social logo

raphaelheinz / leethub-3.0 Goto Github PK

View Code? Open in Web Editor NEW
94.0 94.0 59.0 21.49 MB

This plugin automatically pushes your code to GitHub when you pass all tests on a Leetcode problem.

License: MIT License

JavaScript 87.02% CSS 2.63% HTML 10.36%
leetcode

leethub-3.0's People

Contributors

a-aznar avatar arjixwastaken avatar arnabsen1729 avatar arunbhardwaj avatar asahu16 avatar ayoung19 avatar aystream avatar benlowenthal avatar bpires avatar bro3886 avatar dipta007 avatar itsluminous avatar jeremytsaii avatar mahbubcseju avatar mayankkumar2 avatar myu-ekata avatar njelich avatar qasimwani avatar raphaelheinz avatar syssn13 avatar tuminzee avatar zafei-erin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leethub-3.0's Issues

Too Broad Github Permissions are being asked

Is your feature request related to a problem? Please describe.
When we authorize this application to github , it is asking read / write for all public and private repos. Similar to Admin Access
It would be much better to reduce to scope of the application to read and write to selected repos or use fine grained Access tokens.

Add Problem List and Solution Link in README

Is your feature request related to a problem? Please describe.
The current feature offers a great way to backup solutions and track progress via commits, which I really appreciate. However, it would even be better to automate the process of index creation so that one can navigate through solved problems and find solution in O(1).

Describe the solution you'd like
When pushing new problem to GitHub, extract information such as problem no., title, url, (optionally) difficulty, tags, and add them as a new row to a markdown table in the parent README file.

Ideally, the solution link on Github should be included. However, since the url is only formed after commit, not sure if there is an elegant way of doing it.

Describe alternatives you've considered
Doing it manually.

Additional context
Not any.

Trick to populate?

I cannot seem to get this to save my solutions from leetCode to the repository it creates in my GitHub. I am signed into leetcode through GitHub and I am using Opera GX for a browser. The extension seems to be installed properly. Let me know what else I can do to trouble shoot

[1661. Average Time of Process per Machine] with 403 Forbidden?

First of all, I would like to express my gratitude. I would like to contribute by looking at the source code to solve this problem, but I don't think I have the skills to do so yet.

I submitted 1661. Average Time of Process per Machine, a correct answer doesn't have a response to commit Github. But when submitted from a different one of problems, it was uploaded to GitHub normally.

This error appears on the console.

bam.nr-data.net/jserrors/1/8d5fb92f6e?a=1100293087&v=1.252.0&to=ZwMAYEdSCktRWxZRXV5JJEFbUBBRX1ZNSF5RHwVGWkYKXB5OC11FQ1wxXFRBAVxgVANBVUIJF1pRZQ1dRxYFXUY%3D&rst=22480&ck=0&s=52c7394b446403a1&ref=https://leetcode.com/playground/R2bRmArg/shared&hr=0:1

   Failed to load resource: the server responded with a status of 403 ()

nr-spa-1.252.0.min.js:2

   POST https://bam.nr-data.net/jserrors/1/8d5fb92f6e?a=1100293087&v=1.252.0&to=ZwMAYEdSCktRWxZRXV5JJEFbUBBRX1ZNSF5RHwVGWkYKXB5OC11FQ1wxXFRBAVxgVANBVUIJF1pRZQ1dRxYFXUY%3D&rst=12474&ck=0&s=52c7394b446403a1&ref=https://leetcode.com/playground/aorLQLoE/shared&hr=0 403 (Forbidden)

I saw the questions before but it didn't seem to exist. Thank you.

Enhance LeetHub with Manual Sync Button and Status Messages for Reliable GitHub Repository Updates

Feature Request: Manual Submission Button for Repository Updates on LeetHub

Problem Statement

I've encountered an issue with the current LeetHub extension where code submissions on LeetCode do not consistently synchronize with my GitHub repository. This inconsistency requires me to refresh the tab and resubmit my solutions multiple times, which is inconvenient and disrupts my workflow.

Proposed Solution

I suggest adding a manual button within the LeetHub extension that allows users to manually trigger an add/update operation for the LeetCode problem in their repository. This feature would provide more control over the synchronization process, ensuring that submissions are properly recorded in the GitHub repository without needing to repeat submissions.

Alternative Solutions

In addition to the manual submission button, implementing status messages would significantly improve the user experience by providing immediate feedback. These messages could include notifications such as "Creating commit" or "Submission not recorded", giving users clarity on the action's outcome and whether further steps are necessary.

Additional Context

This feature request stems from personal experiences and discussions with other users facing similar synchronization challenges. Enhancing the extension with these capabilities would streamline the coding practice and submission process, making LeetHub even more valuable for the coding community.

Need to change relevant link to extension in Readme.md for Chrome web store

Please review previous closed issues before filling out a new one! Duplicate issues will be closed without comment.

Describe the bug
Need to change the relevant links to extention in chrome store as it now leads to the old one

To Reproduce
Steps to reproduce the behavior:

  1. Go to open README.md
  2. Click on [LeetHub]

Expected behaviour
Navigating to the correct URL in Chrome Web Store

Screenshots
image

Language not found for Pandas exercises

Describe the bug

When I submit Pandas exercises, the error Could not find language is thrown.

I tried simply adding it to the list of languages here:

/* Enum for languages supported by LeetCode. */
const languages = {
C: '.c',
'C++': '.cpp',
'C#': '.cs',
Dart: '.dart',
Elixir: '.ex',
Erlang: '.erl',
Go: '.go',
Java: '.java',
JavaScript: '.js',
Javascript: '.js',
Kotlin: '.kt',
MySQL: '.sql',
'MS SQL Server': '.sql',
Oracle: '.sql',
PHP: '.php',
Python: '.py',
Python3: '.py',
Racket: '.rkt',
Ruby: '.rb',
Rust: '.rs',
Scala: '.scala',
Swift: '.swift',
TypeScript: '.ts',
}

but, for some reason I wasn't able to pinpoint, this is not taken into account.

Adding Pandas to the list of languages directly into getLanguageExtension did the trick. Here, just before the return:

LeetCodeV2.prototype.getLanguageExtension = function () {
if (this.submissionData != null) {
return languages[this.submissionData.lang.verboseName];
}

To Reproduce
Steps to reproduce the behavior:

  1. Submit a working Pandas exercise.

For example, the exercise modifySalaryColumn with code:

import pandas as pd

def modifySalaryColumn(employees: pd.DataFrame) -> pd.DataFrame:
    employees.salary *= 2
    return employees

Expected behavior

Pandas exercises should be recognized as Python code, so with extension .py.

Additional context

Tested using Dynamic layout (because I was not able to make LeetHub-V3.0 work at all in Split View layout).

submission gave red flag even the solution was Accepted

Describe the bug
the extension shows a red flag even the solution was Accepted.

To Reproduce
Steps to reproduce the behavior:
find a question that you already solved before. so the old code will retrieved by LeetCode.

  1. click reset button to clear the old code
  2. write the code
  3. click Submit button
  4. wait... I didn't do anything... just wait
  5. red flag

Expected behavior
Accepted solution should have green flag and submitted to GitHub. But now shows red flag without commit to Github.

Screenshots
image

Not working if keyboard shortcut is used to submit

Please review previous closed issues before filling out a new one! Duplicate issues will be closed without comment.

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
When the problem is submitted through keyboard shortcut cmd + enter, the extension doesn't work.

Describe alternatives you've considered
If submitted using click, it works.

Additional context
I can open a PR if you are busy.

LeetHub v3 not pushing code to GitHub

Description:
@raphaelheinz I've been using LeetHub v3 for about a week now, and it has been working fine. However, today (08/05/2024), after submitting my code, it passed all the test cases but did not push the code to GitHub. I tried manually pushing by pressing the push button multiple times, but it didn't work. I suspect the issue might be related to the recent UI changes made by LeetCode in the user profile summary section. Every time there's a UI change on LeetCode, it seems to cause a bug with LeetHub.

To Reproduce:

  1. Go to LeetCode.
  2. Submit code using LeetHub v3.
  3. Observe that the code passes all test cases.
  4. Manually press the push button.
  5. Notice that the code is not pushed to GitHub.

Expected Behavior:
After passing all test cases and pressing the push button, the code should be pushed to GitHub as usual.

Screenshot:
Screenshot 2024-05-08 115449

Additional Context:
I've been using LeetHub v3 without any issues until today. The only noticeable change I've seen is the update in the LeetCode UI, particularly in the user profile summary section. It seems that every time there's a change in the UI, it affects LeetHub's functionality.

Supporting PostgreSQL

Please review previous closed issues before filling out a new one! Duplicate issues will be closed without comment.

It seems uploading PostgreSQL is not supported yet, in contrary of other DBs such as MySQL. So, it would be great if LeetHub v3 will support PostgreSQL.

The LeetCode problem number is not the same as LeetHub-2.0

The LeetCode problem number is not the same as LeetHub-2.0

Describe the bug
It seems that LeetCode problem number generated by LeetHub-3.0 is not the same as LeetHub-2.0. For example, when I use LeetHub-2.0 with old UI of LeetCode, I got the correct problem number for the following problems: 1004-max-consecutive-ones-iii and 1234-replace-the-substring-for-balanced-string. But when I use LeetHub-3.0 with new UI of LeetCode, I got the incorrect problem number: 1046-max-consecutive-ones-iii and 1351-replace-the-substring-for-balanced-string.

For problems with small numbers, it seems that LeetHub-3.0 works fine.

Screenshots
Screen Shot 2023-12-03 at 1 33 05 PM

Still does not work on New version of Leetcode UI

Please review previous closed issues before filling out a new one! Duplicate issues will be closed without comment.

Describe the bug
I tried 0.0.1, 0.0.2, and 0.0.3 but all three versions cannot detect code submissions on newer UI. I'm not a frontend engineer so I can't tell which log is helpful and which one is not. If you specify the prodcedure to collect logs properly, I'll give you ASAP.

Manual sync button shown in user profile

Describe the bug
Since the last release, a button for manual synchronization has been added. Please check #25 for this. Unfortunately, this button is also shown in the user profile. I am not sure if it is on other pages as well. We will probably need additional checks to make sure this button is only added in an editor page?

Screenshots
image

@itsluminous do you have an idea what we can further do?

Navigate Event Handler does not catch latest URL

Describe the bug
The navigate event handler does not catch the latest URL but the previous URL. It is always exactly one click behind. Sometimes this leads to push the wrong submission to GitHub. It seems that the event handler is called before the actual link is changed ๐Ÿค”

LeetCodeV2.prototype.addUrlChangeListener = function () {
window.navigation.addEventListener('navigate', event => {
const problem = window.location.href.match(/leetcode.com\/problems\/(.*)\/submissions/);
const submissionId = window.location.href.match(/\/(\d+)(\/|\?|$)/);
if(problem && problem.length > 1 && submissionId && submissionId.length > 1){
chrome.storage.local.set({ [problem[1]]: submissionId[1] });
}
})
};

To Reproduce
Steps to reproduce the behavior:

  1. Add console.log() to track the window.location.href value.
  2. Switch between different tabs, submissions, ...
  3. Check console.log() messages. They will be exactly one click behind.

Expected behavior
The event listener should somehow access the latest URL instead of the previous URL.

Additional
This issue may be responsible for #29.

Not working when using two languages with the same problem on Leetcode

Describe the bug
I use Python to solve the problem first. After that, I used Golang to solve this problem on Leetcode but It's not working, or sometimes it worked. But I don't know why

To Reproduce
Steps to reproduce the behavior:

  1. Submit a solution with Python
  2. Submit a solution with Golang
  3. Go to GitHub repo to check the commit

Expected behavior
A new commit with the Golang language

Additional context
Sometimes the extension does not working, then I have to submit it multiple times

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.