gist

How to create a gist on command line

◇◆丶佛笑我妖孽 提交于 2019-12-03 13:10:06
问题 I am trying to create a gist from bash, and I have tried many versions scripts I could get, but none are working. This seems like a correct one, but it does not work also. curl -X POST -d '{"public":true,"files":{"test.txt":{"content":"String file contents"}}}' https://api.github.com/gists I have a test.txt file with content I would like to create the gist, but it won't work. It says, invalid email , if I try to add -u USER or -u USER:PASS it still won't work saying "message": "Problems

Is there a permalink to the latest version of gist files?

我们两清 提交于 2019-12-03 08:54:09
问题 I created a gist with two files, the raw version of which I would like to use as a reference for an application which will query their contents. These contents will be updated on GitHub. I found however that the URL of the file changes with each version of the gist. Is there a permalink which would point to the latest version of a file in a gist? 回答1: Raw gist URLs follow the pattern below: https://gist.githubusercontent.com/[gist username]/[gist ID]/raw/[gist commit ID]/[file name] To view

Gist like on Github for Bitbucket

廉价感情. 提交于 2019-12-03 06:30:44
问题 I'm search some like as http://www.gistboxapp.com for http://www.bitbucket.com. Exist anything like that? 回答1: For Bitbucket, unfortunately, the current answer is NO. There is also an issue (Issue #516) report about this on Bitbucket issue trakers. You may follow its status there. Updated: As of Mar. 19, 2015, Bitbucket has made this feature available, check out https://bitbucket.org/snippets . 回答2: Good news, everyone! Today I noticed that snippets are available on BitBucket: https:/

How to embed only certain lines from a gist?

蓝咒 提交于 2019-12-03 04:55:20
Gist lets you embed a gist in a web page: <script src="https://gist.github.com/dyoo/4627246.js"></script> I was hoping I could have it display just a line range subset. (Use case: Write some code for a blog post in a single gist. Reference certain lines throughout the blog post discussing those lines.) Is this possible? I can't find it documented, but is there some way to do it? As an example of how I thought it might work, GitHub supports URIs with line numbers. For example, the #L4-L8 anchor in this: https://github.com/twitter/bootstrap/blob/master/docs/base-css.html#L4-L8 I realize GitHub

Is it possible to make relative link to image in a markdown file in a gist?

天涯浪子 提交于 2019-12-03 04:26:03
问题 I've got a gist which contains a markdown file and an image. Is there a way to do a relative link to this image? Something like ![My image](image.png) instead of ![My image](https://gist.github.com/user/605560c2961cb3025038/raw/b75d2...6e8/img.png) Here is an example 回答1: As of now, relative image links are working for me, in both a repository and a wiki. I'm using syntax like this: ![Kiku](images/Kiku.jpg) Here's an example: https://github.com/mark-anders/relative-image-url 回答2: According to

How to create a gist on command line

梦想的初衷 提交于 2019-12-03 03:18:48
I am trying to create a gist from bash, and I have tried many versions scripts I could get, but none are working. This seems like a correct one, but it does not work also. curl -X POST -d '{"public":true,"files":{"test.txt":{"content":"String file contents"}}}' https://api.github.com/gists I have a test.txt file with content I would like to create the gist, but it won't work. It says, invalid email , if I try to add -u USER or -u USER:PASS it still won't work saying "message": "Problems parsing JSON", .. I don't know what is wrong. the documentation does not provide much except for this line:

How do I pipe something from the command line to a new Github gist?

偶尔善良 提交于 2019-12-03 03:12:13
问题 I don't know if this exists yet, but I'd love to be able to do: $ cat mygist.js | gh new gist And have it return the URL (and possibly copy it to the clipboard / open it in the browser). 回答1: Try this gem: https://github.com/defunkt/gist Worked for me ^_^ 回答2: Seems like GitHub has a simple REST API, including methods for creating Gists. Just for fun: $ curl -X POST \ --data-binary '{"files": {"file1.txt": {"content": "Hello, SO"}}}' \ https://api.github.com/gists This successfully created

Is there an internal alternative to gist.github.com to run behind a firewall?

陌路散爱 提交于 2019-12-03 02:18:33
问题 gist.github.com is incredibly handy, but I'd like to be able run something similar for sharing code samples internally with other developers behind the firewall where I work, so I don't constantly need to be sanitising my code all the time, just to talk about code examples. Does anything like this exist? I'm not after big project management tools, just a way to make throwaway gists, and share links easily, that also happen to be git repos, just like gist.github.com 回答1: You may check pastgit:

How to change the name of a gist in github?

匆匆过客 提交于 2019-12-03 02:06:51
问题 Is there a way to change the name of a gist (github) ?, apparently it is ordering the files of the gist in alphabetical order, an naming the gist according to the file that appears first. 回答1: Considering the order of files within a gist is asciibetical, you can try and add one file in uppercase. That file will come before any other and will define the name of your gist. Note that it won't change the url of said gist, as explained in "Namespaced Gists". 回答2: Even better, you can add a file

How to clone a Github Gist via SSH protocol?

安稳与你 提交于 2019-12-03 01:35:59
问题 Github really seems to want us to use the HTTPS protocol to use Gists, for example, they only list the HTTPS url on a Gist page - e.g. https://gist.github.com/donatello/5834862 Is it possible to clone a Gist using SSH protocol? 回答1: Yes, it is possible: git clone git@github.com:5834862.git Just replace with your own Gist ID of course. 回答2: https://help.github.com/articles/which-remote-url-should-i-use#ssh-readwrite---gitgithubspanspancom git@..... is the ssh protocol when you copy the clone