Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

DropBox Integration written in Codea!

edited November 2012 in Code Sharing Posts: 666

All -

I have finished writing the DropBox integration piece. This will allow you to read/write inside of a DropBox sandbox.

i plan on using this to archive my source code directly from the iPad, but there are a LOT of other uses. (High Scores, text file output, LUA LoadString() code (!), etc).

https://gist.github.com/4091848

Note that you will need to link Cider (get 1.5) and the JSON parser (in the above GIST) for this to operate. Hmmm..you might also need to stub out the dump() function - I use it to dump tables, it is in the XmlParser code base I have. Torn out it is:

function dump(_class, no_func, depth)
    if(not _class) then 
        log("nil");
        return;
    end

    if(depth==nil) then depth=0; end
    local str="";
    for n=0,depth,1 do
        str=str.."\t";
    end

    log(str.."["..type(_class).."]");
    log(str.."{");

    for i,field in pairs(_class) do
        if(type(field)=="table") then
            log(str.."\t"..tostring(i).." =");
            dump(field, no_func, depth+1);
        else 
            if(type(field)=="number") then
                --AC: Want the long number, not scientific notation.
                log(str.."\t"..tostring(i).."="..string.format("%0.0f",field));
            elseif(type(field) == "string") then
                log(str.."\t"..tostring(i).."=".."\""..field.."\"");
            elseif(type(field) == "boolean") then
                log(str.."\t"..tostring(i).."=".."\""..tostring(field).."\"");
            else
                if(not no_func)then
                    if(type(field)=="function")then
                        log(str.."\t"..tostring(i).."()");
                    else
                        log(str.."\t"..tostring(i).."<userdata=["..type(field).."]>");
                    end
                end
            end
        end
    end
    log(str.."}");
end
Tagged:

Comments

  • The JSON parser isn't included in the GitHub link. The link is broken.

  • Posts: 666

    Github is acting wierd. None of my stuff is there anymore and when I create a new gist, it shows up on the title bar and I can load it with my gist client app, but I can't see then via the website.

    I'll make a different link....probably a public share on SkyDrive or Dropbox.

    I thought a gist wasn't a good idea...:(

  • SimeonSimeon Admin Mod
    Posts: 5,383

    .@aciolino this is a great project idea. You could look at using a full GitHub account to store and manage the code. I'm not sure what happened to your gist.

  • Posts: 666

    For some reason, I was having a heck of a time getting files to post in a GitHub project. I still haven't quite figured out what client to use and the website doesn't seem to be helpful...

  • I read the other day that GitHub was having a lot of issues with Gists and such. Their site even went down for several hours. Hopefully it's just a side-effect of that.

  • I found the github help to be more helpful than the one of bitbucket in the past, one reason why I chose github at that time. Things change fast these days and the bitbucket docs are more helpful now. They also offer Mercurial repositories, that allows you to use TortoiseHg on Windows which I find convenient to use for my everyday work. Github offers their own client for MacOS and Windows, but they hide it a bit behind a button if you start with the "Set Up Git" page. If you're on Linux then you may use TortoiseHg as well, so you can follow the Mercurial docs on bitbucket.

  • Posts: 666

    @Codeslinger, I'm trying to keep it to the iPad as much as possible, so I was using Gist (since I have a client for it on my iPad). GitHub on the iPad doesn't have an app that allows you to post to your GITs.

    Though the stuff is still gone it renders labels showing that I had it up there at one point.

    sigh

  • edited December 2012 Posts: 666

    @TheKraken stuff is still not loading, so I don't think it's coming back. I'l have to repost it.

  • Is this back online somewhere?

Sign In or Register to comment.