gist

What is the difference between GitHub and gist?

谁说我不能喝 提交于 2019-12-03 00:00:12
问题 What is the purpose of gist and how is it different from regular code sharing/maintaining using GitHub? 回答1: GitHub is the entire site. Gists are a particular service offered on that site, namely code snippets akin to pastebin. However, everything is driven by git revision control, so gists also have complete revision histories. 回答2: My Personal View of Gist and GitHub: Gist: Gist is a simple way to share code snippets and pastes with others. It is used when you need to share a sample piece

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

孤人 提交于 2019-12-02 16:41:00
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). Try this gem: https://github.com/defunkt/gist Worked for me ^_^ 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 this Gist . I guess it's enough to get you started. Here's a simple bash script that takes a filename and makes it

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

旧时模样 提交于 2019-12-02 15:50:19
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 weakish You may check pastgit: git backed paste server (gist python clone) https://github.com/mmikulicic/pastgit Also gitpaste:

How to change the name of a gist in github?

北城余情 提交于 2019-12-02 15:41:52
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. VonC 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 ". Even better, you can add a file with a leading space in its name. It's virtually invisible and gives you more freedom when choosing the

How to clone a Github Gist via SSH protocol?

人盡茶涼 提交于 2019-12-02 15:22:31
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? Yes, it is possible: git clone git@github.com:5834862.git Just replace with your own Gist ID of course. https://help.github.com/articles/which-remote-url-should-i-use#ssh-readwrite---gitgithubspanspancom git@..... is the ssh protocol when you copy the clone url for a gist it shows you the https clone url https://gist.github.com/5834862.git change https:// to git@ and /*

Sublime Text2 和 gist 打造自己的代码片断库

ε祈祈猫儿з 提交于 2019-12-02 15:10:21
注意:本篇博文,mac下适用,其他操作系统应该大同小异。 程序员做久了,或多或少都有自己的代码积累,但是如果没有好的管理软件,想要找到以前的某个代码片段还真不容易,会浪费不少时间,百度了一下有个比较好的解决方案是 Sublime Text2 + gist ,网上虽说有很多的教程例子,但是部分地方说得不够详细,对于一个新人来说还是会浪费不少时间,所以整理了下。 第一步,下载 Sublime Text2并安装,下面是官方网站: http://www.sublimetext.com/ 第二步, Sublime Text2支持很多插件,其中就有gist的插件,但是要安装这些插件必须要先安装插件管理器 package controll 下面是安装介绍页面: https://sublime.wbond.net/installation#st2 简单看了下,大概意思是,package controll 的安装有两种方式,一种是控制台安装(推荐),打开 Sublime Text2,菜单 view -> show Console 然后把下面的代码复制进去(或者你直接到上面的网站中复制),回车安装,然后重启下 Sublime Text2就可以了 。 import urllib2,os,hashlib; h =

What is the difference between GitHub and gist?

你。 提交于 2019-12-02 13:47:19
What is the purpose of gist and how is it different from regular code sharing/maintaining using GitHub? GitHub is the entire site. Gists are a particular service offered on that site, namely code snippets akin to pastebin. However, everything is driven by git revision control, so gists also have complete revision histories. Jayavignesh Vicky My Personal View of Gist and GitHub: Gist: Gist is a simple way to share code snippets and pastes with others. It is used when you need to share a sample piece of code or technique with your co-workers or friends. And GitHub GitHub, on the other hand,

Github gist page won't load in iframe

断了今生、忘了曾经 提交于 2019-11-30 20:19:25
I want to list all my gists on a single page and an iframe seemed like the quickest and easiest solution, the problem is that it won't load. My example show the same html used to make gist.github.com and google.com show in an iframe. Google will load but github won't. Is this a limitation that Github imposes, is there a better way to list embed all my gists on a single page without adding each gist individually? I want it to show up automatically when I create a new one. http://jsfiddle.net/guanome/VGEjB/1/ Considering GitHub won't let you display its content with a frame, lime Rob mention in

How do I get the raw version of a gist from github?

你说的曾经没有我的故事 提交于 2019-11-30 11:26:03
问题 I need to load a shell script from a raw gist but I can't find a way to get raw URL. curl -L address-to-raw-gist.sh | bash 回答1: And yet there is, look for the raw button (on the top-right of the source code). The raw URL should look like this: https://gist.githubusercontent.com/{user}/{gist_hash}/raw/{commit_hash}/{file} Note: it is possible to get the latest version by omitting the {commit_hash} part, as shown below: https://gist.githubusercontent.com/{user}/{gist_hash}/raw/{file} 回答2:

How do you control the order in which files appear in a GitHub gist

扶醉桌前 提交于 2019-11-30 10:32:19
问题 Is there a way to control the order in which files appear in a gist? They don't seem to be alphabetical or chronological. I'd like to have a README.md appear as the first file in a multi-file gist, but no amount of "deleting" a file and re-adding it seems to change anything. Is there an order to these files that I'm not seeing, or does GitHub maintain an internal filetype priority list? 回答1: Since at least 2018, the order is alphabetical, with periods and numbers coming before letters. Around