Friday, 1 November 2013

#FLMobiGame: Using GitHub to share your source code

In a previous blog I described how to use Pastebin to share your source code. In this blog I am going to describe how to use GitHub Gists to share your source code. We need this work around because at the moment FutureLearn platform is in Beta release and does not support source code sharing in comments.

Step 1: 
You will see a web page similar to this
GitHub Gists Website
Step 2: 
Select the source code that shows errors in your program and copy it (CTRL+C). Now paste it in the text box (CTRL+V). It would look something like this:
Paste your source code here
Step 3: 
You will notice that even though we see Java syntax highlighted in eclipse IDE here it is not. It is much easier to read the source code if syntax is highlighted. So let us make it so. Click on the down arrow near to 'Language' (shown in next figure). This will give you a drop down list. Select 'Java' from the drop down list because we are coding in Java.
Select Source code language
Step 4: 
Notice the syntax highlighting.
Syntax highlighted source code
Step 5: 
Now click on the 'Create Public Gist'.
Click Create Public Gist
Step 6: 
Now click on the 'Create Public Gist'. It will take you to the following screen
Copy Gist Link
Step 6: 
Now click on the select the whole text in 'Link to this gist' text box. (You can do this by clicking on text box and doing a CTRL+A). Now copy this link (CTRL+C).

Step 7: 
In your FutureLearn post (or comment) paste the link to your code.
Comment with GitHub Gist link
I hope this guide was useful, feel free to leave your comments.

No comments:

Post a Comment