- 代码搜索网站
- Github代码搜索技巧
- Searching code
- Considerations for code search
- Scope the search fields
- Search by language
- Search by the number of forks the parent repository has
- Search by code size
- Search by the location of a file within the repository
- Search by filename
- Search by the file extension
- Search within a user’s or organization’s repositories
写在前面:
如本文描述有错误,希望读到这篇文章的您能够提出批评指正。 联系方式:172310978@qq.com
参考文章:
代码搜索网站
- 代码:
GitHub
Codase
Ohloh
krugle
Merobase Component Finder
Google Code Archive - SymbolHound
可以搜索特殊符号的搜索引擎,程序员的福音,遇到 Bash、正则之类的问题时候的利器! - Hoogle
Haskell 的专用函数搜索引擎,妈妈再也不用担心我的 Functional Programming - RSeek.org R-project Search Engine
R 语言专用搜索。 - findjar.com
JAR 搜索引擎,对 Java 编程有帮助。 - Microsoft Research
微软内部搜索,好东西多多,经常会发现 Google 学术搜不到的技术文献 - 针对 SEO 排名的知识搜索引擎:SEO优化网,完全在线学习 + 公式化结构化的 SEO 搜索算法
- CA App Synthetic Monitor网站监控服务
从世界各地查询网站的 Ping 结果。
Github代码搜索技巧
很多人搜索github,但是芸芸众生,要找到自己想要的项目犹如海底捞针一般,今天教大家几项神技,可以快速找到自己想要的内容。
1、按star数目搜索
比如JavaScript,要求星数,这样就能获取star数目最多的项目
2、follow一些github上面的大牛
请登录:https://github-ranking.com/
国内大牛:http://outofmemory.cn/github/
这里是搜索名人的网址:https://github.com/search
高级搜索:https://github.com/search/advanced
3、Awesome + 你的关键字:搜索一些优秀的框架、教程、项目等
4、看一些搜索技巧,设定条件进行搜索
地址:https://help.github.com/articles/searching-repositories/
5、通过readme看看人家是否发出pull request
看看这篇文章:http://blog.csdn.net/qianlong4526888/article/details/11529981
6、看explore推荐
7、看看其他
http://blog.sina.com.cn/s/blog\_4e60b09d0102vcso.html
8、直接github上搜fackbook或者其他,可以看到他们的最新作品
Searching code
代码搜索
To search for code, use the following search qualifiers in any combination.
Tip: There’s a list of search syntaxes you can add to any search qualifier to further improve your results.
Considerations for code search
Due to the complexity of searching code, there are a few restrictions on how searches are performed:
- Only the default branch is considered. In most cases, this will be the
master
branch. - Only files smaller than 384 KB are searchable.
- You must always include at least one search term when searching source code. For example, searching for
language:go
is not valid, whileamazinglanguage:go
is. - At most, search results can show two fragments from the same file, but there may be more results within the file.
- You can’t use the following wildcard characters as part of your search query:
., : ; / \ ` ' " = * ! ? # $ & + ^ | ~ < > ( ) { } []
. The search will simply ignore these symbols.
以上是代码搜索中需要注意的一些问题
默认搜索是从master分支搜索代码
只有小于384k的代码才是可以搜索到的
搜索的时候必须包含至少一个搜索关键词 如amazing language:go
搜索语句不能有特殊字符如., : ; / \ ` ' " = * ! ? # $ & + ^ | ~ < > ( ) { } []
.
Scope the search fields
指定搜索方式
Matches code where “octocat” appears in the file contents.
搜索文件中有octocat的代码
Matches code where “octocat” appears in the path name.
搜索路径中有octocat的代码
Matches code where “octocat” appears in the file contents or the path name.
搜索路径中有octocat的代码或者文件中有octocat的代码
Matches code with the word “display,” that’s marked as being SCSS.
搜索用scss写的包含display的代码
Matches code with the word “Integer”.
搜索包含Integer的字段
Search by language
通过语言搜索代码
You can search for code based on what language it’s written in. For example:
Matches code with the word “element” that’s marked as being XML and has exactly 100 bytes.
搜索大小为100字节的xml代码
user:mozilla language:markdown
Matches code from all @mozilla’s repositories that’s marked as Markdown.
搜索mozilla用户下用markdown写的代码
Search by the number of forks the parent repository has
通过fork的数量或者是否有父节点的方式搜索
If you would like forked results to appear, add the fork:true qualifier. For example:
android language:java fork:true
Matches code in a forked repository with the word “android” that’s written in Java.
搜索用java写的 android相关的代码并且被fork过
Search by code size
The size qualifier filters results based on the size of the file in which the code is found. For example:
function size:>10000 language:python
Matches code with the word “function,” written in Python, in files that are larger than 10 KB.
搜索与function相关的python代码,文件大小超过10kb
Search by the location of a file within the repository
按照目录结构搜索
By including the path qualifier, you specify that resulting source code must appear at a specific location in a repository. Subfolders are considered during the search, so be as specific as possible. For example:
console path:app/public language:javascript
Finds JavaScript files with the word “console” in an app/public directory (even if they reside in app/public/js/form-validators).
在 app/public directory目录下搜索console关键字
form path:cgi-bin language:perl
Finds Perl files under cgi-bin with the word “form” in them.
搜索cgi-bin目录下包含form的perl代码
Search by filename
通过文件名搜索
You can use the filename qualifier if there’s a specific file you’re looking for. For example:
Finds *.vimrc* files with the word “commands” in them.
搜索 文件名匹配*.vimrc* 并且包含commands的代码
minitest filename:test_helper path:test language:ruby
Finds Ruby files containing the word “minitest” named *test_helper* within the *test* directory.
在test目录中搜索包含minitest且文件名匹配”*test_helper*“的代码
Search by the file extension
根据扩展名来搜索代码
The extension qualifier matches code files with a certain extension. For example:
form path:cgi-bin extension:pm
Matches code with the word “form,” under cgi-bin, with the .pm extension.
搜索cgi-bin目录下以pm为扩展名的代码
icon size:>200000 extension:css
Finds files larger than 200 KB that end in .css and have the word “icon” in them.
搜索超过200kb包含icon的css代码
Search within a user’s or organization’s repositories
通过用户或者组织来查找
To grab a list of code from all repositories owned by a certain user or organization, you can use the usersyntax. For getting a list of code from a specific repository, you can use the repo syntax. For example:
本文转自 https://blog.csdn.net/shuimuzy/article/details/55506706,如有侵权,请联系删除。