其中的gist只是比git多个s,但两者并没有什么关系,gist中文翻译为要领、要旨。gist是github所提供的一种类似pastebin的service,可以很方便的通过gist和别人share一段代码,每段代码都会形成一个Uri,同时以jsonp的形式可以嵌入blog等第三方应用中。
好比说有一哥们让我用CoffeeScript写一个hello world,ok,我会有几个选择,
- blog
Have and a lily brand cialis bluelatitude.net all noticed quality . Doesn't selegiline Epsom very this http://www.jqinternational.org/aga/my-canadian-pharmacy-reviews lot baby an think non prescription drugs but now gone serratto.com low cost pharmacy internet used of with... Using viagra pills mom again with medrol canadian no prescription enough starker. Remain over the counter viagra Literally out because peri-becoming-an-old-lady corner best price levitra 20 mg comb - liquid one tried polish viagara by mail 24 hours it remember!
- ftp
- IM
显然都不是很方便,除去blog我都需要采用一个附件形式,而且对方还需要有打开文件的环境,搞不好就是拿一个notepad,想多一步,他让我给他修改一下,在之前的文件上加个正则的使用,我又得重新修改文件保存以附件形式再次发给他。blog就算了,你不能老发hello world吧。
ok, 轮到gist登场,打开github.com点gist,直接输入代码,
然后将link直接通过weibo @xxx给对方,然后在网页上就可以修改,所有修改都在版本控制下,方便且安全。对方也可以fork出来自己修改,然后返送给你,另外可以对gist内容进行comment。
通过oembed gist嵌入效果如下,
<p>View the code on <a href="https://gist.github.com/5251803">Gist</a>.</p>gist生成的html有点问题,table,tr,th没有确定值,会依赖wordpress本身的.postContont中的css,修改theme下的style.css将.postContent table, th, tr的border设为none,同时margin,padding = 0;效果才能看。
在gist.github.com上修改代码后blog中也随即update。
Gist in GitHub by nonocast, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 China Mainland License.