常泡LC的朋友知道LC是不提供代码打包下载的,不像一般的OJ,可是我不备份代码就感觉不舒服…

其实我想说的是…

我自己写了抓取个人提交代码的小工具,放在GitCafe上了…

不知道大家有没有兴趣

https://gitcafe.com/aaronzhou/
... ssion

拿Java写的,也打了一个包,本地有JRE环境就能运行,欢迎拍砖

抓取 LeetCode OJ 个人提交的代码

  • Gradle 构建项目
  • HttpClient、jsoup 抓取、解析网页

使用说明

  • 进入release文件夹
  • 修改init.properties 中的配置
        #登录账号
username=your_username #登录密码
password=your_password #登录类型,值暂时只能为leetcode或github
logintype=leetcode #抓取的代码在本地的存储目录
#注意目录路径最后需有一个斜杠/
dirpath=/path/to/your/own/directory/ #是否抓取所有的提交代码
#为假时参考tags集合的取值有选择的抓取
isfetchall=false #抓取与集合中状态匹配的代码
tags=Accepted,Wrong Answer,Time Limit Exceeded
  • 命令行中运行 java
    -jar FetchLeetcodeSubmission.jar
     抓取代码
  • 输出的代码文件,内容依次为
    • 本项目信息
    • 题目标题
    • 题目URL
    • 你提交的代码
    • 题目内容

项目说明

  • 使用gradle
    release
    可直接打包最新项目到release文件夹
jar {
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
manifest {
attributes 'Main-Class': 'cc.aaron67.fetch.leetcode.main.Main'
}
} task release(type: Copy) {
from 'build/libs'
into 'release'
} task copyConfig(type: Copy) {
from 'init.properties'
into 'release'
} release.dependsOn 'build', 'copyConfig'

备份LeetCode OJ自己编写的代码的更多相关文章

  1. 最新的JavaScript核心语言标准——ES6,彻底改变你编写JS代码的方式!【转载+整理】

    原文地址 本文内容 ECMAScript 发生了什么变化? 新标准 版本号6 兑现承诺 迭代器和for-of循环 生成器 Generators 模板字符串 不定参数和默认参数 解构 Destructu ...

  2. LeetCode OJ 题解

    博客搬至blog.csgrandeur.com,cnblogs不再更新. 新的题解会更新在新博客:http://blog.csgrandeur.com/2014/01/15/LeetCode-OJ-S ...

  3. LeetCode OJ学习

    一直没有系统地学习过算法,不过算法确实是需要系统学习的.大二上学期,在导师的建议下开始学习数据结构,零零散散的一学期,有了链表.栈.队列.树.图等的概念.又看了下那几个经典的算法——贪心算法.分治算法 ...

  4. LeetCode OJ 297. Serialize and Deserialize Binary Tree

    Serialization is the process of converting a data structure or object into a sequence of bits so tha ...

  5. LeetCode OJ 之 Maximal Square (最大的正方形)

    题目: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and ...

  6. LeetCode OJ:Integer to Roman(转换整数到罗马字符)

    Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 t ...

  7. LeetCode OJ:Serialize and Deserialize Binary Tree(对树序列化以及解序列化)

    Serialization is the process of converting a data structure or object into a sequence of bits so tha ...

  8. LeetCode OJ——Text Justification

    http://oj.leetcode.com/problems/text-justification/ 编译代码要看warnings!它提供了可能出问题的情况,比如类型转换上unsigned int ...

  9. 最新的JavaScript核心语言标准——ES6,彻底改变你编写JS代码的方式!

    原文地址 迁移到:http://www.bdata-cap.com/newsinfo/1741515.html 本文内容 ECMAScript 发生了什么变化? 新标准 版本号6 兑现承诺 迭代器和f ...

随机推荐

  1. 远程执行shell脚本

    ssh -p2016 apache@10.10.18.130 '/bin/sh /data/www/vhosts/WOStest3_ENV/update_env.sh' 需要设置shell远程免密码登 ...

  2. ready()事件;使外置JS代码正常运行

    JavaScript代码放在哪里? 浏览器在渲染HTML页面时,是从头到尾,一行一行地检查执行的.如果JavaScript代码在前面,HTML元素在后面,遇到JavaScript选择一个还未渲染的HT ...

  3. PaperNotes Instance-Level Salient Object Segmentation

    title: PaperNotes Instance-Level Salient Object Segmentation comments: true date: 2017-12-20 13:53:1 ...

  4. JAVA 数据类型数组

    普通int: public class Array { //成员变量 private int[] data; private int size; //构造函数,传入数组的容量capacity构造Arr ...

  5. hadoop集群运行jps命令以后Datanode节点未启动的解决办法

    出现该问题的原因:在第一次格式化dfs后,启动并使用了hadoop,后来又重新执行了格式化命令(hdfs namenode -format),这时namenode的clusterID会重新生成,而da ...

  6. jquery .On()绑定事件的触发机制

    选择器只能选择已存在元素,其他元素需要作为参数传递给on

  7. noi2016旷野大作战

    玩了差不多两个小时61分 大概第9个点可以再拿5-6分 但是挺麻烦的并不想搞.. 这道题还是比较考验智商的??以及对那个特殊的ln函数的应用 感觉题目出的挺好的 看了题解 发现第4个点的确我应该想不到 ...

  8. 【BZOJ4155】[Ipsc2015]Humble Captains

    题解: 第一问裸的最小割 第二问考虑贪心 我们把边权平均分配给两个点 然后就变成了给n个数分两组差最小 np-hard问题 暴力背包,操作存在区间左移,右移,or bieset优化

  9. Orchard是如何工作的?

    文章翻译自http://docs.orchardproject.net/Documentation/How-Orchard-works 对Orchard的理解还不深刻,翻译可能有不好的地方.     ...

  10. JMeter选择协议踩过的坑