Thursday, October 15, 2015

Github Misc



https://help.github.com/en/articles/pinning-items-to-your-profile

https://stackoverflow.com/questions/20422279/github-pages-are-not-updating
https://help.github.com/en/articles/troubleshooting-github-pages-builds

https://github.com/blog/1901-managing-issues-and-pull-requests-across-repositories

https://github.com/pulls
Use them to quickly find issues you've created. Or pull requests that mention your username. Or issues that have been assigned to you. Or go ahead and use any of our custom advanced search filters and create your own often-used search... the sky's the limit.
https://help.github.com/articles/using-keyboard-shortcuts/
tActivates the file finder
lJump to a line in your code
wSwitch to a new branch or tag
yExpand a URL to its canonical form
iShow or hide comments on diffs
bOpen blame view

https://help.github.com/enterprise/2.8/user/articles/about-pull-request-reviews/
  • Comment: Submit general feedback without explicitly approving the changes or requesting additional changes.
  • Approve: Submit feedback and approve merging the changes proposed in the pull request.
  • Request changes: Submit feedback that must be addressed before the pull request can be merged.
https://help.github.com/articles/searching-code/
The in qualifier limits what fields are searched. With this qualifier, you can restrict your search to the source code, the file path, or both. Without the qualifier, only the file contents are searched.
octocat in:file
Matches code where "octocat" appears in the file contents.
octocat in:path
Matches code where "octocat" appears in the path name.
octocat in:file,path
Matches code where "octocat" appears in the file contents or the path name.
display language:scss
Matches code with the word "display," that's marked as being SCSS.

Search by the source code file 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

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).
form path:cgi-bin language:perl
Finds Perl files under cgi-bin with the word "form" in them.

Search by filename

You can use the filename qualifier if there's a specific file you're looking for. For example:
filename:.vimrc commands
Finds *.vimrc* files with the word "commands" in them.
minitest filename:test_helper path:test language:ruby
Finds Ruby files containing the word "minitest" named *test_helper* within the *test* directory.

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.
icon size:>200000 extension:css
Finds files larger than 200 KB that end in .css and have the word "icon" in them.

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 theuser syntax. For getting a list of code from a specific repository, you can use the repo syntax. For example:
user:github extension:rb
Matches code from GitHub that ends in .rb.
repo:mozilla/shumway extension:as
Matches code from @mozilla's shumway project that ends in .as.
Search
https://help.github.com/articles/search-syntax/
Exclude results containing a certain word
You can also narrow your search results by excluding words with the NOT syntax. Searching for Hello returns a massive number of "Hello World" projects, but changing your search to include hello NOT world returns fewer results.

The NOT operator can only be used for string keywords. It does not work for numerals or dates.

Filter qualifiers based on exclusion

Another way you can narrow down search results is to exclude certain subsets. Prefixing any search qualifier with a - excludes all results that are matched by that qualifier.
cats stars:>10 -language:javascript
mentions:defunkt -user:github
https://help.github.com/articles/searching-code/
  • You can't use the following wildcard characters as part of your search query: . , : ; / \ ` ' " = * ! ? # $ & + ^ | ~ < > ( ) { } [ ]. The search will simply ignore these symbols.
language:java -filename:Test
console path:app/public language:javascript

Search by filename
You can use the filename qualifier if there's a specific file you're looking for. For example:
filename:.vimrc commands


Search by the file extension
The extension qualifier matches code files with a certain extension. For example:
form path:cgi-bin extension:pm

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 user syntax. For getting a list of code from a specific repository, you can use the repo syntax. For example:
user:github extension:rb
repo:mozilla/shumway extension:as
http://stackoverflow.com/questions/22411063/searching-for-on-github
GitHub search is based on elasticsearch, which has reserved characters than you can escape.
'>' and '<' are optional operators used for intervals, and it doesn't seem for that character to be escaped (in the way GitHub is using or has configured ealasticsearch).
http://stackoverflow.com/questions/26433561/how-to-search-on-github-to-get-exact-matches-like-what-quotes-do-for-google
"filter class" in:file filename:logback.xml
To enable exact matches with quotes you need to follow your search with the "in:file" modifier. The matches are not quite exact, the word "class" will have to follow the word "filter", but it seems there can be 0 or more spaces or symbols characters between the two words.

http://usersnap.com/blog/github-hacks-productivity/
Trace changes in a file with Git blame
I’m not sure why they named this awesome feature “blame”. But despite it’s name, git blame is pretty cool. It’s an super easy way to display changes of any file. Simply click on the blame button in the code view in order to get an overview on all changes which have been made.

Send line links

Did you know that you share links to a certain code line (or multiple lines)? Simply select the line in the code view and you’ll see how the URL will change. You can even select multiple lines by pressing “SHIFT”.

Get more out of GitHub Issues with Usersnap

Another great thing about GitHub is it’s integration possibilities with other awesome services. I therefore recommend to take a look at github.com/integrations and check out the available integration possibilities with tools (you might be already using).
By connecting Usersnap with GitHub Issues you can make your bug reporting and testing efforts much more pleasant. Screenshots created by your colleagues, testers, website visitors or clients are automatically (or manually if you want) sent to your GitHub Issues.
https://github.com/AntBranch/awesome-github
https://github.com/tiimgreen/github-cheat-sheet

Syntax Highlighting in Markdown Files

For example, to syntax highlight Ruby code in your Markdown files write:

```ruby
require 'tabbit'
table = Tabbit.new('Name', 'Email')
table.add_row('Tim Green', 'tiimgreen@gmail.com')
puts table.to_s
```
Read more about GitHub Flavored Markdown.
Emojis can be added to Pull Requests, Issues, commit messages, repository descriptions, etc. using :name_of_emoji:.
The full list of supported Emojis on GitHub can be found at emoji-cheat-sheet.com or scotch-io/All-Github-Emoji-Icons. A handy emoji search engine can be found at emoji.muan.co.
The top 5 used Emojis on GitHub are:
  1. :shipit:
  2. :sparkles:
  3. :-1:
  4. :+1:
  5. :clap:
Images and GIFs can be added to comments, READMEs etc.:
![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif)
Raw images from the repo can be used by calling them directly.:
![Alt Text](https://github.com/{user}/{repo}/raw/master/path/to/image.gif)

Task Lists


In Issues and Pull requests check boxes can be added with the following syntax (notice the space):

- [ ] Be awesome
- [ ] Prepare dinner
  - [ ] Research recipe
  - [ ] Buy ingredients
  - [ ] Cook recipe
- [ ] Sleep

Revert a Pull Request

After a pull request is merged, you may find it does not help anything or it was a bad decision to merge the pull request.
You can revert it by clicking the Revert button on the right side of a commit in the pull request page to create a pull request with reverted changes to this specific pull request.

https://help.github.com/articles/closing-a-pull-request/
You may choose to close a pull request without merging it into the upstream branch. This can be handy if the changes proposed in the branch are no longer needed, or if another solution has been proposed in another branch.
    https://gist.github.com/peterflynn/5980273#file-bookmarklet-js
    Show outdated comments:
    $(".outdated-diff-comment-container").addClass("open");

    https://github.com/stefanbuck/awesome-browser-extensions-for-github
    GitHub Highlight Selected
    https://chrome.google.com/webstore/detail/github-highlight-selected/lhiklbgjcblimmjjflobpncgihagcmbj/related

    https://github.com/blog/967-github-secrets

    w & t

    Navigate your project quickly. On your repository's home page, type w to quickly bring up a quick filter panel for your branches. Inside of your repository, type t to jump into a quick file selector. Select your file, hit enter, and you're gold. There's also a slew of other shortcut keys you can use, depending on the page- just hit ? to see them.
    https://github.com/tiimgreen/github-cheat-sheet
    Ignore Whitespace
    Adding ?w=1 to any diff URL will remove any changes only in whitespace, enabling you to see only that code that has changed.

    Adjust Tab Space
    Adding ?ts=4 to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8.

    Commit History by Author
    To view all commits on a repo by author add ?author={user} to the URL.
    https://github.com/rails/rails/commits/master?author=dhh

    Comparing Branches
    To use GitHub to compare branches, change the URL to look like this:
    https://github.com/{user}/{repo}/compare/{range}
    Where {range} = master...4-1-stable
    https://github.com/rails/rails/compare/master...4-1-stable
    https://github.com/rails/rails/compare/master@{1.day.ago}...master
    https://github.com/rails/rails/compare/master@{2014-10-04}...master
    Dates are in the format YYYY-MM-DD

    Pressing t will bring up a file explorer.
    Pressing w will bring up the branch selector.
    Pressing s will focus the search field for the current repository. Pressing Backspace to delete the “This repository” pill changes the field to search all of GitHub.
    Pressing l will edit labels on existing Issues.
    Pressing y when looking at a file (e.g. https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md) will change your URL to one which, in effect, freezes the page you are looking at. If this code changes, you will still be able to see what you saw at that current time.

    Line Highlighting in Repositories
    https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60
    Closing Issues via Commit Messages

    If a particular commit fixes an issue, any of the keywords fix/fixes/fixed, close/closes/closed or resolve/resolves/resolved, followed by the issue number, will close the issue once it is committed to the master branch.

    $ git commit -m "Fix screwup, fixes #12"

    如何用Github去管理你的Idea
    http://zhuanlan.zhihu.com/phodal/20442311

    Github装逼指南——Travis CI 和 Codecov

    Labels

    Review (572) System Design (334) System Design - Review (198) Java (189) Coding (75) Interview-System Design (65) Interview (63) Book Notes (59) Coding - Review (59) to-do (45) Linux (43) Knowledge (39) Interview-Java (35) Knowledge - Review (32) Database (31) Design Patterns (31) Big Data (29) Product Architecture (28) MultiThread (27) Soft Skills (27) Concurrency (26) Cracking Code Interview (26) Miscs (25) Distributed (24) OOD Design (24) Google (23) Career (22) Interview - Review (21) Java - Code (21) Operating System (21) Interview Q&A (20) System Design - Practice (20) Tips (19) Algorithm (17) Company - Facebook (17) Security (17) How to Ace Interview (16) Brain Teaser (14) Linux - Shell (14) Redis (14) Testing (14) Tools (14) Code Quality (13) Search (13) Spark (13) Spring (13) Company - LinkedIn (12) How to (12) Interview-Database (12) Interview-Operating System (12) Solr (12) Architecture Principles (11) Resource (10) Amazon (9) Cache (9) Git (9) Interview - MultiThread (9) Scalability (9) Trouble Shooting (9) Web Dev (9) Architecture Model (8) Better Programmer (8) Cassandra (8) Company - Uber (8) Java67 (8) Math (8) OO Design principles (8) SOLID (8) Design (7) Interview Corner (7) JVM (7) Java Basics (7) Kafka (7) Mac (7) Machine Learning (7) NoSQL (7) C++ (6) Chrome (6) File System (6) Highscalability (6) How to Better (6) Network (6) Restful (6) CareerCup (5) Code Review (5) Hash (5) How to Interview (5) JDK Source Code (5) JavaScript (5) Leetcode (5) Must Known (5) Python (5)

    Popular Posts