Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My local project has some code that is not working, and I'd like to show it to someone to have a look at and possibly give me a hand with it. This isn't a short snippet or a single file; there are multiple files and directories involved.

How can I best publish my code?

share|improve this question
4  
Extract the piece that is not working, make it a self-contained, executable example and post it on StackOverflow, together with a detailed description of what was the expected output and how it failed :) –  Niklas B. Jun 21 '12 at 18:48
2  
There is also codereview.stackexchange.com ... –  Intentss Jun 21 '12 at 20:00
2  
@NiklasB. you cannot make self-contained executables of interpreted code without going through a great deal of trouble. Much more than I'd probably like to go through for just showing a quick example to someone... –  David Planella Jun 21 '12 at 22:35
    
@David: I didn't mean executable in the sense of executable. I meant it in the sense of "one can copy the code and execute it without endless adaptions". A lot of supporters don't actually do that, they can often spot errors without executing the code, in which case it helps if there is as few lines of code as possible (obviously still containing the error). –  Niklas B. Jun 21 '12 at 23:29
1  
@Intentss: Codereview is for working code ONLY. Stack Overflow is glad to help with broken but short code samples. –  Niklas B. Jun 21 '12 at 23:29
show 5 more comments

4 Answers 4

up vote 25 down vote accepted

Use Launchpad's +junk branch feature to publish your code to a temporary location. In fact, it is not temporary, as it will remain there until you explicitly delete it, but it is a nice place to put unfinished code you're experimenting with on a public location.

This way it will stay out of the way from your regular branches, but you'll still be able to access it and show it to everyone online.

The only requirement is that you've got a Launchpad account and have uploaded SSH keys and finished the procedure to use Launchpad for code hosting.

After that, you simply need to run this command on your terminal, from the location where your code lives:

bzr push lp:~<your-launchpad-id>/+junk/<name-of-your-temp-branch>

That's it! You'll then be able to point other people to https://code.launchpad.net/~<your-launchpad-id>/+junk/<name-of-your-temp-branch>

share|improve this answer
    
So far this is the only solution that allows multiple files. THanks for sharing I can see this being handy someday. –  stefgosselin Jun 21 '12 at 20:41
1  
This can also be done using Github, BitBucket and other repository hosts in a very similar manner. –  Niklas B. Jun 21 '12 at 23:40
    
Just as a little note, the bzr push command can be abbreviated/simplified to bzr push lp:~/+junk/[branch_name] as Launchpad should reslve your username from your identifying yourself and your SSH keys. –  hexafraction Oct 6 '12 at 12:59
add comment

Use a GitHub gist - You don't even need to register.

share|improve this answer
1  
A good suggestion, but that is similar to just using a pastebin, and will only let you share single files. You can put entire source trees in a +junk branch. –  David Planella Jun 21 '12 at 15:46
    
@DavidPlanella, you can have multiple files in a gist (github.com/blog/550-multiple-file-gist-improvements) –  Mihai Rotaru Jun 21 '12 at 22:02
1  
That's right, but as mentioned, you cannot keep the source tree structure there. For that, you'd need a full-blown bzr or git branch. –  David Planella Jun 21 '12 at 22:30
add comment

There's also Codereview SE, which is in public beta. Maybe not the best place for a big project, but another option.

share|improve this answer
3  
The Code Review SE FAQ states that the code must be working to post. If the code isn't working Stack Overflow is probably a better match. –  KennyPeanuts Jun 21 '12 at 16:56
    
@DQdlM A good point, thanks. –  JoeFish Jun 21 '12 at 17:01
add comment

If what you want to be reviewed is a single file, you can use any one of the number of popular Pastebin services.

I would personally recommend Ubuntu's Pastebin Service.

share|improve this answer
    
OP is asking about multiple files –  Merlin Jun 26 '12 at 19:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.