Github notes
From raju
dummy
favorite configuration
git config user.name "Kamaraju S. Kusumanchi" git config user.email kamaraju@gmail.com
For ssh keys
ssh-keygen -t rsa -C "kamaraju@gmail.com"
Add the key to ssh-agent
ssh-agent -s ssh-add ~/.ssh/id_rsa
To copy the key
clip < ~/.ssh/id_rsa.pub
ssh key fingerprint
ssh-keygen -l -f ~/.ssh/id_rsa -E md5
regenerate private key from public key
ssh-keygen -y -f ~/.ssh/id_rsa
repository url
Sample repository url
https://github.com/<user>/<project>.git git@github.com:<user>/<project>.git
create first page
https://github.com/<user>/<project>/new/master
zip archive of a repo
Add /archive/master.zip to the end of a repo's URL. For example https://github.com/USER/REPO/archive/master.zip
Add table of contents to mediawiki files
To add the table of contents to a mediawiki file of a project wiki, use
__TOC__
See https://github.com/KamarajuKusumanchi/market_data/wiki/earnings for an example.
useful links
- close issues with commit - https://help.github.com/articles/closing-issues-using-keywords/
- searching code - https://help.github.com/articles/searching-code/
- https://stackoverflow.com/questions/21811581/fork-gist-to-repo-on-github - talks about how to import a gist into a github repository.
Useful github repos
- https://github.com/bjornstromeqt/lambda-finance/blob/master/src/google_finance/historical.py - queries finance.google.com using "import requests" module and passes query parameters as separate argument. This is strictly not necessary for google finance data as it can be obtained directly by using pd.read_csv as shown in https://github.com/KamarajuKusumanchi/market_data_processor/blob/master/google_finance.py . But want to keep this as it might be useful for getting data from other websites.
- https://github.com/rsheftel/pandas_market_calendars - calendars of stock exchanges to use with pandas for trading applications
- https://github.com/ChrisCummins/labm8 - uses "pip install -r requirements.txt" in .travis.yml and the requirements.txt has lines that specify the minimum required versions of a package (ex:- pandas >= 0.19.0)
- https://github.com/apache/arrow
- https://github.com/apache/arrow/tree/master/python - python API for underlying C++ libraries
- Uses https://github.com/apache/arrow-testing as a submodule. The arrow-testing contains data files used in testing.
Check later
Sort later
- github hosts 78 million Git repositories.
Ref:- https://blog.github.com/2018-03-05-measuring-the-many-sizes-of-a-git-repository/
my github stars
missing features
- If a csv file contains comments at the beginning, github does not render it as described in https://help.github.com/articles/rendering-csv-and-tsv-data/
change remote's url from https to ssh
git remote set-url origin git@github.com:USERNAME/REPOSITORY.git
For example
git remote set-url origin git@github.com:KamarajuKusumanchi/notebooks.git
Ref:- https://help.github.com/articles/changing-a-remote-s-url/
specify tab space width
Add ?ts=N to the URL. For example https://github.com/nayuki/Project-Euler-solutions/blob/master/python/p053.py?ts=4 will display tabs as 4 spaces wide and https://github.com/nayuki/Project-Euler-solutions/blob/master/python/p053.py?ts=8 will display them as 8 spaces wide.
github markdown notes
- comments
<!-- blah blah -->
- headings
### is bigger than #####
- quoting
``` blah blah ```
or
`blah blah`
- click and expand
<details> <summary>Click to expand</summary> whatever </details>
tags | collapsible
See https://github.com/ContinuumIO/anaconda-issues/issues/10992 for an example.
download a single file
curl https://raw.githubusercontent.com/user/repository/branch/filename -O
Ref:- https://stackoverflow.com/questions/4604663/download-single-files-from-github
Example: The pdf version of OpenIntro Statistics 4th edition book is located at https://github.com/OpenIntroStat/openintro-statistics/blob/master/main.pdf . I downloaded it using
curl https://raw.githubusercontent.com/OpenIntroStat/openintro-statistics/master/main.pdf -O
nbviewer links
Change github.com with nbviewer.jupyter.org/github
For example
https://github.com/KamarajuKusumanchi/notebooks/blob/master/pandas/Select%20rows%20and%20columns.ipynb -> https://nbviewer.jupyter.org/github/KamarajuKusumanchi/notebooks/blob/master/pandas/Select%20rows%20and%20columns.ipynb
Use case:
Some times github shows the following error when trying to display an ipython notebook
Sorry, something went wrong. Reload?
A workaround is to use nbviewer.jupyter.org.
searching code
search in a particular file
search python files
Use
language:python
search my repositories
user:KamarajuKusumanchi
tags | author
search by file extension
extension:sh -extension:java
tags | search files with an extension
remove results from a user
-user:foo