Das Ding ist selbsterklärend, es gilt nur zu beachten, dass man einen Github-Account benötigt, wenn man Gists hinterher nochmal editieren möchte. Auch bekommt man beim initialen Befüllen kein on-the-fly Syntax-Highlighting und Einrücken. Daher zuerst eingeloggt den leeren Gist mit der entsprechenden Dateierweiterung speichern und gleich wieder zum Editieren öffnen. Dann gibt's on-the-fly Formatierung und Einfärbung.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hello World as a Gist :-) on gist.github.com | |
// Gist is very handy for storing and sharing Code-Snippets especially for | |
// embedding them in Blog-Posts (e.g. on Blogger) | |
// A great advantage for an interested reader ist, that he can immediately fork it | |
// into his own Gist-Repository to use it :-) | |
// Note: you can only edit gists, if you created them while signed in | |
// When first typing the gist, you don't instantly get | |
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
cout << "Hello World" << endl; | |
exit 0; | |
} |
Ich hab mich schon immer gefragt, warum blogger eigentlich keine brauchbare Umgebung für Code oder den Output aus der Kommandozeile hat. Werde mir Gist mal anschauen für meine nächsten Posts, wenn ich mal wieder Code brauche. Aber irgendwie wäre es praktischer, wenn man nicht jedes Code Snippet gleich irgendwo hosten müsste. Geht das auch ad hoc?
AntwortenLöschen