I just finished building the new version of an old project, Codr.cc.
It allows you to store, share, or broadcast notes or code. You can drag-and-drop files onto it. I took a lot from notepad.cc in the way it saves automatically to the server. Append '/extension' to your links to activate real-time syntax highlighting, currently supporting:
js, html, css, php, c, cpp, java, py, haskell, smalltalk, and stex (I should list that somewhere...)
Each file has a public link you can share from where the file cannot be edited.
Changes to the file can bee seen in really real time from either end of the (non-public) url.
I can't provide a concrete answer since I have to write new parsers myself, and I'm not familiar with scala. However, if I see the project take off in any significan way, I will dedicate some time to adding support for more languages :)
That reminds me that I should put some contact info up on the site somewhere...
Could you have an extension of /preview or /render that would render the page live on the broadcast side. This would be great for teaching/demos. Even better if they can switch between code/render view.
On the read-only version of the page, placing the cursor and hitting "enter" adds newlines. They don't show up in anyone else's session AFAICT, but it's a little disconcerting to get the impression of editing what was supposed to be a read-only document :)
I really like the idea and implementation. Its pretty neat for collaborative code editing and much better for editing code then etherpad or google docs. I think this should be the main focus. I think i will use it primarily to discuss and develop code with other ppl.
But I won't use it for a pastebin as i really love http://paste.pocoo.org/ which supports syntax highlighting for many languages, an api to upload files, great python commandline util, support for multiple files with different syntax highlights in one paste etc. JFTR the most important thing for me to use codr.cc as a pastebin would be an api/commandline util and more languages
And thanks for the bonus of making this work on the iPad. It's one of the first things I do when I come across a new browser-based editor. It has a few quirks, but definitely usable. (I found that I had to display the page pull-down info panel to trick the iPad keyboard to show. As an aside, I wonder if there's a bookmarklet to force out the iPad keyboard. Or a bookmarklet to fake tabs.)
* Opened page in new tab, switched to tab after reading a few other things.
* Saw a url in the drop-down at the top, different to url of page, briefly pondered whether I should go to that instead.
* Decided to copy/paste and go there.
* Couldn't type in editor, closed tab thinking it didn't work in Chrome on OSX.
Now it's a holiday in the UK, and sunny too amazingly, so I'm just quickly flicking through items of interest but people generally don't read what you put in front of them. I've read through the comments now and, while one anecdote isn't data, you may want to think about how you present the write-version/read-only-version URLs.
The url from the dropdown is a url you can share from where no edits can be made. For example, for sharing code on twitter, or broadcasting it (any changes from the main url are still seen in real time).
I think the searching and categorizing could be public, but perhaps pro users could get eclipse/textmate/whatever plugin + api access to do some automatic stuff. You could have it do a search on the current empty method name and return any similar-sounding snippets in the current language, ready for embedding and sourcing, complete with comments.
You could even have a special kind of in-source comment that links the snippet to the web URL so you can track changes and automatically show the differences and "accept" the changes to your source code. New way to collaborate :)
Those are some very interesting ideas, I especially find the similar snippet lookup thing.
However, for that particular one a more robust database of snippets would probably be necessary, and it would take a long amount of time to gather enough snippets for it to be really useful.
As to some of the other features, I think they go beyond the scope of the project. The premise of codr.cc is to allow you to share code (live or not) using a simpler interface than all the other pastebins out there. That's why I took all of the features that might go a bit beyond that and labeled them pro.
However, I very much like the idea of an API and local plugins. Stuff like a command-line interface etc. would be very interesting :)
I like it, but I would personally recommend locking on a line level. I shouldn't be able to hold backspace on the same line my collaborators are editing IMO. Another added bonus would be to do a very faint row level highlight to show where other contributors are. Lastly, just to show a list of the current page contributors.
For line (row) level locking, add handling to only allow one user to edit a particular line at a time.
For each user currently on the page, assign them a discreet palette color. Highlight the current line each user is on with their color to give indication to all other users what line everyone else is on/modifying.
Have a sidebar (collapsible/expandable) on the page that shows all given users on the current page, along with their personal color. This lets you associate live edits to a particular user. This would function much the same as using Google Docs (i.e. spreadsheets).
I shouldn't be able to hold backspace on the same line my collaborators are editing IMO. Another added bonus would be to do a very faint row level highlight to show where other contributors are. Lastly, just to show a list of the current page contributors.
- Funny you should say, I'm actually on OS X Chrome and I don't find it all that choppy. Could you elaborate on that?
- You're probably right.
- I figured the root url (codr.cc) serves as a new pastebin button.
- As I mentioned in another comment, I have to write new code engines by myself, which is a bit harder with languages I'm not familiar with. However, if I see the project take off, I will put some time into supporting more and more languages.
You could also add basic Forth support very easily. In Forth, everything is composed of whitespace-delimited tokens. A token is either an integer or a word. Forth uses metaprogramming to make the syntax extensible, but the most common words with special syntax are comments and string constants.
\ is a single-line comment that skips until the next newline, ( is a multiline comment that skips until the next end paren, ." is an inline print string that scans until the next quote, and it has a counterpart .s" string constant that works the same. Bingo, one basic Forth tokenizer!
There's a great manual for GForth, in case you're curious to see what some code looks like or give the language a spin.
Lisp has some of the easist syntax there is (only other contender is whitespace).
(+ 5 4)
"Hello I like your service"
`(this is read as a list of keywords rather than as a call to the function this with the rest as arguments ,the-value-of-me-is-inserted-due-to-the-comma this-keyword-is-not-changed))