Open jiminggist opened 11 years ago
It would be possible to cache gists on to disk, but there would have to be a decision on whether to cache on opening a gist or caching all gists "all the time"
Caching brings with it problems of staleness and of course takes up space
The staleness is easy, in case we are connection to the internet, using the online version from gist ALL the time, just ignore and update the local cache. In offline mode, using cache then.
Yes, that would get rid of staleness, but it would also annihilate the actual use of caching, since getting the gists is pretty slow even for a few gists.
I'd be much more inclined to actually cache gists and use local files and check for new version when opening them or something similar.
Yes, it's better! Especially you can update all items in gist into local.
.gists
folder under $HOME, and git clone all gists of a github user using ssh protocol
. e.g.: git clone git@gists.github:12345.git
. Gist plugin
create a gist finished normally, just clone the newly create gist into .gists
folder. open gist
command, use cloned version in .gists
folder instead of accessing the api. update gist
and update all gists
. let user decide when and which to update. username
and password
when you git push
. that's why I prefer ssh. git clone
way will not be able to modify description
of the gistThe idea is genius. +1.
Using ssh is a really bad Idea as the whole API is built around HTTPS and github tries to get people to use it. SSH needs credentials just like HTTPS so that is not a valid argument.
Forcing the user to update gist for himself is totally redundant and defeats the purpose of this plugin. It would make more sense to cache only loaded files and then comparing timestamps when opening a cached file
Merged with issue #16
@AeroCross said:
Thank you (and anyone who has contributed to this plugin, too) for such a magnificent plugin. It's saving lives, I tell you.
This isn't an issue — it's more of a feature suggestion.
I was wondering if there's any change to add offline access of some sort. Since gists need internet connection, it could be useful if the snipped is saved elsewhere — if there's access, check and update if necesary, but if there's not, just use the cached version.
I use gisty set on cron in order to sync all my gists.
However, it would be really awesome at least to be able to create a mapping between gist repos and Sublime Gist plugin. I mean, it's good to have ~/.gists directory, but sometimes I directly backup local files to gist.github (f.e. ~/.gitconfig). It works well when I create gist from a file; it's possible to update it, but, unfortunately, Gist plugin loses its internal mappings after restart.
So far the best I came for syncing files back up with is zsh oneliner:
cd $GISTY_DIR/91f354bfe4a4c9a82a46; git pull -q origin master; \
cp ~/.gitconfig .; git commit -v -a -e -m "$(date)" && git push origin master
Plus, I have custom script which automatically pushes changes for choosen Sublime user settings files. Anyway, contact me if you would like a hand with gisty setup (I use encapsulated rvm wrapper) or so on.
hello guys, this is a really useful features that can be included in the plugin. seems the repo isn't active development anymore,
guys, how about we pick this up and work it out together?
Is it possible to save a copy of all gist in local? If the network is connected, using the one from gist. Otherwise we still have a copy in local and still can work.