Features for code sharing

what’s the best way to share code? I have a hobby of teaching my kids to program. my hobby extended to an online site. Every week some kid wants to share code. They don’t know how to use github. With discourse, do they just zip up their code and attach it as a file? Is there a better mechanism to integrate Discourse and GitHub or something that can help share code? I need something more than embedding the code in a post because there are multiple files, many with graphics for the games.

Wouldn’t be too hard to teach them the basics of GitHub though? (teach them GitHub, not Git)
(GitHub for Windows/Mac is easy!)

As for any integration with Discourse, I doubt there could be anything discussion-wise that isn’t already covered on GitHub. =)

1 Like

You can edit the authorized_extensions admin setting to allow upload of .zips:

On this site, the admin has enabled uploading of .pdf files and files with no extension by adding |.pdf| on the end.

However, I suggest using Gist if you need to quickly share multiple code files without assets like images.

All of the GitHub /user/repo/blob/... URLs onebox nicely in Discourse, so you can use that too.

2 Likes

Thanks for the answer. The *.zip file will probably work.

I am new to Discourse and don’t quite understand the onebox concept.

Does this refer to a standalone link to the repository? I’ll put a test in below

Gist and Pastebin are great, but not sufficient since there are many graphic assets. The typical child is making games. My curriculum is also based on making games for Android. Since much of the application failure is happening on the Android phone itself due to things like incorrect directory references, I need to test the entire app package, not just the code snippet.

I’ve tried to get them to use GitHub, but it appears to be a bit challenging. My own son often has problems using it with me sitting right next to him. I only upload things to GitHub with git from the command line. Is there another way to upload a package with 20 files in it?

GitHub has a bunch of features on it for discussing code, but it’s a bit overwhelming.

I think I can use block code snippets in Discourse posts combined with *.zip file bundle uploads into the forum.

Although this is a hobby, this concept of integrating discussion and code sharing may bridge into my work at some point. The discussions on GitHub are code-centric. I like the people-centric focus of Discourse discussions.

or

Native desktop clients for GitHub(and Git itself). Easy to use even for a child.

2 Likes

@ArmedGuy thanks for sharing this. I need to take another look at these clients.

My hobby is based on me teaching my son and daughter to program with Python. I occasionally make a YouTube video and occasionally share some code on GitHub.

When I get comments from other kids, it is very rewarding to try and answer the questions. However, I don’t have too good of a mechanism to accept and respond to their questions.

These native desktop clients for Mac/Windows will probably be useful. My son is using ubuntu and kind of struggling with the git commands. Too bad they don’t have a graphical GitHub Linux client that looked the same as the Windows/Mac clients. I could then get my son to take screenshots of how to use it.

Anyway, thanks for your help. I better get back to actually doing work. :smile:

1 Like