Skip to main content

A small utility for making gists

Project description

mkgist

A small utility for making gists. When I need to share code snippets online, the formatting always ends up totally messed up when I copy-paste manually. This alleviates that.

Setup

For general use, it's a good idea to keep it somewhere in your path. Because the endpoint requires authentication, you should create a JSON file with your credentials called .mkgist.conf at the home directory. For example,

{
  "username": "user",
  "password": "password"
}

To install dependencies, run pip install -r requirements.txt after installing. I don't use this within a virtual environment, but doing so would look something like this:

virtualenv -p $(which python3) $HOME/virtualenv/mkgist
source $HOME/virtualenv/mkgist/bin/activate

Usage

mkgist filenames [-d "description"] [--public] [--raw] [--nocopy]
  • If no filenames are entered, the contents of the gist are read from STDIN.
  • The location of the created gist is printed to stdout.
  • Gists are secret by default, but can be made public with --public. (Secret gists aren't indexed by search engines)
  • --raw returns a link to the raw hosted file, which you can then get with curl or wget. If multiple files are created with this flag, the URLs are always printed to stdout.
  • By default, the URL of the created Gist is copied to the clipboard. --nocopy prints the link to stdout instead, not overwriting the clipboard.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkgist-2.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

mkgist-2.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file mkgist-2.0.tar.gz.

File metadata

  • Download URL: mkgist-2.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mkgist-2.0.tar.gz
Algorithm Hash digest
SHA256 1a7be48324be389277f4f000fc98cf7351c25c55f547f4ecbe23b87d17fa8dda
MD5 f60eb8841ed4841e37236dc8a29c322d
BLAKE2b-256 ad1c07c5fd9826b3ca33d129674f324fd8ba47046f4b7ba01f9dfa24a4a6c252

See more details on using hashes here.

File details

Details for the file mkgist-2.0-py3-none-any.whl.

File metadata

  • Download URL: mkgist-2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mkgist-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 668090ec28e982b46cb567edb03dd55dd9671d9377f86b88c68dce236aa5c9ce
MD5 60b9f54a1ad715678a752cf40a03e0a9
BLAKE2b-256 b43776adeb80d9ba3010a1fb9e3dfeaab72a77b2cfd852b090ea86d2daa013f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page