All Projects → cuducos → Getgist

cuducos / Getgist

Licence: mit
🖥️ Easily download any file from a GitHub Gist, with one single command.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Getgist

Orange3 Text
🍊 📄 Text Mining add-on for Orange3
Stars: ✭ 83 (-2.35%)
Mutual labels:  hacktoberfest
Bugbounty Starter Notes
bug bounty hunters starter notes
Stars: ✭ 85 (+0%)
Mutual labels:  hacktoberfest
Node Fortran
💀 Fortran bridge for Node.js which allows you to run Fortran code from Node.js.
Stars: ✭ 85 (+0%)
Mutual labels:  hacktoberfest
Entando Core
The entando-core is the repository of the Entando App Engine for Entando 5.X and is the heart of the Entando Platform by providing the primary out-of-the-box services for developing applications.
Stars: ✭ 84 (-1.18%)
Mutual labels:  hacktoberfest
Hacktoberfest2k20
Anyone can send any type of code , I will merge it Asap
Stars: ✭ 85 (+0%)
Mutual labels:  hacktoberfest
Typerep Map
⚡️Efficient implementation of Map with types as keys
Stars: ✭ 85 (+0%)
Mutual labels:  hacktoberfest
Exram.gremlinq
A .NET object-graph-mapper for Apache TinkerPop™ Gremlin enabled databases.
Stars: ✭ 84 (-1.18%)
Mutual labels:  hacktoberfest
Jsql
jSQL is the "official" Javascript Query Language - A database written in Javascript for use in a browser or Node.
Stars: ✭ 85 (+0%)
Mutual labels:  hacktoberfest
Awesome Visjs
🕶️ A curated list of resources around vis.js
Stars: ✭ 85 (+0%)
Mutual labels:  hacktoberfest
Garth
🥁 A really basic theme for Jekyll
Stars: ✭ 85 (+0%)
Mutual labels:  hacktoberfest
Azuracast
A self-hosted web radio management suite, including turnkey installer tools for the full radio software stack and a modern, easy-to-use web app to manage your stations.
Stars: ✭ 1,253 (+1374.12%)
Mutual labels:  hacktoberfest
Pytheory
Music Theory for Humans.
Stars: ✭ 1,260 (+1382.35%)
Mutual labels:  hacktoberfest
Collaboration For Beginners
A Beginner's Guide to Contributing in an Open Source Project.
Stars: ✭ 86 (+1.18%)
Mutual labels:  hacktoberfest
Weakforced
Anti-Abuse for servers at authentication time
Stars: ✭ 84 (-1.18%)
Mutual labels:  hacktoberfest
Mattermost Mobile
Next generation iOS and Android apps for Mattermost in React Native
Stars: ✭ 1,262 (+1384.71%)
Mutual labels:  hacktoberfest
Check
Development environment for Meedan Check, a collaborative media annotation platform
Stars: ✭ 84 (-1.18%)
Mutual labels:  hacktoberfest
Eleicoes Brasil
Scripts para capturar dados do Repositório de Dados Eleitorais do TSE, limpá-los, normalizá-los e agrupá-los
Stars: ✭ 85 (+0%)
Mutual labels:  hacktoberfest
Sa Mp Fixes
Includes and plugins to fix various issues in the SA:MP server that can be fixed externally, leaving the devs time for other things.
Stars: ✭ 84 (-1.18%)
Mutual labels:  hacktoberfest
Core
Open source Dota 2 data platform
Stars: ✭ 1,266 (+1389.41%)
Mutual labels:  hacktoberfest
Aiovk
vk.com API python wrapper for asyncio
Stars: ✭ 85 (+0%)
Mutual labels:  hacktoberfest

Travis CI Coveralls PyPI Version Python Version

GetGist

Easily download any file from a GitHub Gist, with one single command.

Why?

Because of reasons I do not have a dotfiles repository. I prefer to store my init.vim, .gitconfig, .bashrc etc. as Gists.

I wrote this CLI so I could update my dotfiles with one single command: getmy vim.init, for example — and it's done.

Install

$ pip install getgist

GetGist works with Python 3.6+.

To update it just run $ pip install --upgrade getgist.

Usage

Getting Gists from GitHub

Just run getgist <username> <filename>. For example:

$ getgist cuducos .vimrc
  Fetching https://api.github.com/users/cuducos/gists
  Reading https://gist.githubusercontent.com/cuducos/409fac6ac23bf515f495/raw/666d7d01a0058e4fd898ff752db66160f10a60bb/.vimrc
  Saving .vimrc
  Done!

GetGist asks you what to do when a local file (with the same name) exists. If you decide not to delete your local copy of the file, it will be renamed with extensions such as .bkp, .bkp1, .bkp2 etc.

Updating Gists at GitHub

Just run putgist <username> <filename> to update the remote Gist with the contents of the local file. It requires an OAuth token (see Using OAuth authentication below). For example:

$ putgist cuducos .vimrc
  User cuducos authenticated
  Fetching https://api.github.com/gists
  Sending contents of .vimrc to https://api.github.com/gists/409fac6ac23bf515f495
  Done!
  The URL to this Gist is: https://gist.github.com/cuducos/409fac6ac23bf515f495

GetGist asks you what to do when it finds the different files with the same name in different Gists.

Listing Gist files from GitHub

Just run lsgists <username>. For example:

$ lsgists cuducos
  Gist           File               URL
  -------------  ------------------ -------------------------
  First Gist     file.md            https://gist.github.com/…
  My Gist #2     another_file.md    https://gist.github.com/…
  My Gist #2     README.md          https://gist.github.com/…

Using OAuth authentication

Why?

Add your personal access token as as environment variable to allow:

  1. downloading private gists
  2. updating existing gists
  3. listing private gists

How?

  1. Get a personal access token with permission to manage your gists from GitHub settings
  2. Set an environment variable called GETGIST_TOKEN with your personal access token

This article might help you create an environment variable in a Unix-based operational system with Bash, but feel free to search alternatives for other systems and shells.

Example

$ export GETGIST_TOKEN=whatever1234
$ getgist cuducos .vimrc
  User cuducos authenticated
  Fetching https://api.github.com/gists
  Reading https://gist.githubusercontent.com/cuducos/409fac6ac23bf515f495/raw/666d7d01a0058e4fd898ff752db66160f10a60bb/.vimrc
  Saving .vimrc
  Done!
  The URL to this Gist is: https://gist.github.com/cuducos/409fac6ac23bf515f495

This will work even if the file you are trying to download is a private gist (surely the user name has to match the GETGIST_TOKEN account).

Setting a default user

Why?

Set a default user to avoid typing your GitHub user name all the time.

How?

  1. Set an environment variable called GETGIST_USER with your GitHub user name
  2. Use the shortcut getmy <filename>, putmy <filename> or mygists

Example

$ export GETGIST_USER=cuducos
$ getmy .vimrc
  Fetching https://api.github.com/users/cuducos/gists
  Reading https://gist.githubusercontent.com/cuducos/409fac6ac23bf515f495/raw/666d7d01a0058e4fd898ff752db66160f10a60bb/.vimrc
  Saving .vimrc
  Done!
  The URL to this Gist is: https://gist.github.com/cuducos/409fac6ac23bf515f495

Contributing

We use Poetry to manage our development environment:

  1. poetry install will get you a virtualenv with all the dependencies for you
  2. poetry shell will activate this virtualenv
  3. exit deactivates this virtualenv

Feel free to report an issue, open a pull request, or drop a line.

Don't forget to format your code with Black, and to write and run tests:

$ tox
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].