Codea Gister

Built a little something this morning to Gist a Codea project, and vice versa. Enjoy, if you’d like.

@Jmv38 I might add in a single-file ‘export’ mode next time I work on this. Note the ‘bootstrap’ file, it’s just enough code (save for the JSON library [nudges @Simeon :)]) to pull in Gister on it’s own. I wrote this to mainly be a two-way bridge between Codea and my desktop, hence the multi-file layout (I’d go mad keeping everything in a single file), and the best way to ensure Gister keeps working is for it to be self-publishing.

The one ‘blocking’ issue I’m feeling the need to fix is file ordering; the best solution I’ve got in mind right now is including a metadata file with the gist so Gister knows how to order the files. I also considered injecting numbers in the file names to force Gist to maintain order, but since this isn’t a proper Git client you’d likely run into versioning issues when files get moved around (also, it’s ugly :).

Beyond that, it might be neat to implement some browsing so one doesn’t have to juggle Gist IDs all over the place. (This would be improved if there was API support to create new projects, @Simeon)

PS: @Jmv38 If you really want to get into the self-writing-code rabbit hole, take a peek at Metalua ( ) or one of many fine Lisps (like Clojure )

Thanks @acp — this seems like it will be really handy for those sharing code on the forums. I might add it to the FAQ.

Thank you very much @acp. Could you do 1 more thing for us lasy users? Put all the tabs of your project in 1 single gist… It will be much easier to copy and use your code then. Thanks in advance!

Never mind @acp : i’ve just dowloaded you code with @Codeslinger gist loader. Code that loads code that loads code. I think i’m going to upload a gist from @codeslinger code with your code, just to write an insane infinite loop sentence… :wink:

.@acp still exploring an API design for creating new projects. Definitely a possibility in the coming versions.

I’ve just improved the Bootstrap file to only require itself; it’ll pull in the json.lua of it’s own accord.

(Also @simeon, I’d find it neat if Codea’s fancy new autocomplete/docs could pick up on Luadoc within projects, not just for the stdlib)

Thanks acp this is very neat! I’m new to git and I can not seem to get the Authentication token working. I’ve tried to type in what you stated in the readme file but it does not seem to do anything. any pointers? I’d like to keep everything under my account and not annonymous.

Got it! I used

curl \\
--user "username" \\
--data '{"scopes":["gist"],"note":"Codea Gister"}'

I got sick of having to open up Gister to Gist my projects. So, I created a class that when included with my project, will push to Gist if I change Version numbers. It also remembers the GistID so it updates one Gist :slight_smile: Simple to do since @acp did all the hard work

I’ll share it when i get some minor kinks worked out.

@Briarfox - please do!

Well here is what I Have so far. It still needs to be cleaned up and the open url for the first gist isn’t working do to when I set local data, but that’s an easy fix.

@Briarfox - I haven’t used Gister before, and if it’s not too daunting, I’d like to write a tutorial on how to apply it with your mods to allow automatic backup on version change…

But first I have to understand it. Is there a sequence of steps I can follow to set this up (apart from setting up a Github account, of course)?

You need a github Authentication key. I have forgotten how I got it :slight_smile: i believe @acp explains it.

Started a post with AutoGist