V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
binarylu
V2EX  ›  程序员

安利自己写的 leetcode chrome 插件

  •  
  •   binarylu · 2016-03-23 04:28:47 +08:00 · 3571 次点击
    这是一个创建于 2958 天前的主题,其中的信息可能已经有所发展或是发生改变。

    详细介绍:http://v2ex.com/t/264862

    现在已经更新到 0.3.5 版本

    • 新增:隐藏 acceptance 和 difficulty ,只有在提交成功的时候显示。
    • 新增:只提交 Accepted 代码到 github
    • 优化: github 仓库支持关联已有仓库

    欢迎大家提意见

    第 1 条附言  ·  2016-03-25 02:51:54 +08:00
    更新到 0.4.0 版本了
    1. Add countdown for "run code" button and "submit solution" button, so that you will never run/submit too frequently.
    2. Support to set default comment.
    3. Add popup, click LeetCode Extension icon, you can go to leetcode.com directly.

    1. 点击“ run code ”按钮或者“ submit solution ”按钮后,两个按钮会被 disable ,并显示倒数计时,这样就不会出现提交过快的情况了。
    2. 提交 github 的 comment 支持自定义默认的 comment 内容,支持两个变量{title}和{stat}, title 是题目的名称, state 是代码运行的结果,“ Accepted ” “ Compile Error ” 等等这些信息。
    3. 增加一个菜单,在 chrome 上点击插件的图标,可以直接跳转到 leetcode 刷题页面。

    因为增加了一个创建 tab 的权限, chrome 在更新插件的时候竟然提示插件会访问你的历史, chrome 的权限真的是分的够粗放的。以人品担保这个插件不会读你浏览器的任何信息。

    欢迎大家提 issue ,提 bug
    求 star
    15 条回复    2016-03-25 13:38:59 +08:00
    bearcat001
        1
    bearcat001  
       2016-03-23 09:56:00 +08:00
    赞!
    请问如果我既有 cpp 的,又有 java 的,是否可以保留两个文件?
    binarylu
        2
    binarylu  
    OP
       2016-03-23 10:17:59 +08:00
    @bearcat001 可以。选择语言后, filename 文本框里的文件名后缀会自动改变。 filename 里输入不同的文件名就是不同的文件,这么做的初衷是,如果一道题用了多种解法,那么就填入不同的文件名,这样就都保存下来了。不过要注意的是,刷新页面后,文件名会更新为默认文件名, solution + 语言后缀
    bearcat001
        3
    bearcat001  
       2016-03-23 10:31:28 +08:00
    @binarylu 这个太贴心了~ 👍
    bearcat001
        4
    bearcat001  
       2016-03-23 10:36:01 +08:00
    @binarylu 不过那个 add question 和 add readme 按钮好像不 work?
    alexapollo
        5
    alexapollo  
       2016-03-23 10:39:10 +08:00
    看起来挺有趣的
    binarylu
        6
    binarylu  
    OP
       2016-03-23 11:05:40 +08:00
    @bearcat001 额。。。好像是 bug ,我去修复下
    refraction
        7
    refraction  
       2016-03-23 11:30:15 +08:00
    非常感谢!超好用!不过能不能在 commit 信息里面加上题目编号或者名字?我现在的 commit 历史里面全是清一色的“[Accepted]committed by LeetCode Extension ”,都不能看出我做的是哪题
    binarylu
        8
    binarylu  
    OP
       2016-03-23 11:52:42 +08:00
    @refraction 不是有分文件夹吗? comment 也是可以自己改的。我再想想默认的 comment 填什么,加上题目名字不错。
    binarylu
        9
    binarylu  
    OP
       2016-03-23 11:53:09 +08:00
    @bearcat001 已经修复,等到插件自动更新就好了
    refraction
        10
    refraction  
       2016-03-23 12:04:03 +08:00
    @binarylu 确实有分文件夹,但是 comment 里看不出来啊,自己改的话还得每次手动复制一下题目名字贴到 comment 里。我感觉应该提供一个选项把题目名字添加到 commit message 的开头,因为这个插件一次也只能 commit 一个题目。
    就像这样
    "[1-Two-Sum][Accepted]committed by LeetCode Extension"
    binarylu
        11
    binarylu  
    OP
       2016-03-23 12:11:31 +08:00
    @refraction 这个格式不错,下次更新把这个加上
    refraction
        12
    refraction  
       2016-03-23 12:46:51 +08:00
    @binarylu cool! :)
    bearcat001
        13
    bearcat001  
       2016-03-23 15:54:36 +08:00
    @binarylu OK 了~ 这功能好赞!
    binarylu
        14
    binarylu  
    OP
       2016-03-25 02:52:44 +08:00
    @refraction 更新了哈,可以自己配置默认 comment 了
    refraction
        15
    refraction  
       2016-03-25 13:38:59 +08:00
    @binarylu 不错,用上了!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   863 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:40 · PVG 04:40 · LAX 13:40 · JFK 16:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.