-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snippet repository #47
Comments
@amosbird I'm sorry for my late reply. |
IMHO, we could have a dedicated github repo for snippets, and customize |
I would really like to see a good way to share snippets as well, to encourage sharing among groups. I think this could be (more) easily accomplished by supporting multiple directories of snippet files, along with git repos, such that one could clone into the snippet directory in order to combine them all into the full snippet library. Then the distribution model is just |
Having a git repository full of |
Another useful feature would be the ability to specify multiple git repositories as data stores. For the majority of users, one git repo would probably be enough. However, I'd really like the ability to keep general Linux snippets that are broadly applicable synced to a public GitHub repo across my work and home machines, while still being able to store work-specific snippets in a private Git repo. Are you open to PR's implementing the basics of using a directory (or directories) of flat files as the storage mechanism for pet? Git operations could be added once the directory-backed storage is implemented. |
I like the idea of multiple git repository, thus I can have a private storage and also I can use the sheared snippets. With git the change tracking is also solved. |
I've just moved It works well enough as a workaround :-) |
GitHub already functions as a public repository for snippets: https://gist.github.com/search?l=TOML&q=filename%3Apet-snippet.toml. It isn't great, but it is a starting point for anyone looking for one-liners right now, like me 😄 This also allows you to search for specific tools, for example if you are looking for one-liners involving exiftool. |
Yeah. I'm using Lepton as a gist client at the moment for snippets, and the hstr favourites for bash one-liners. |
is there has been any progress on the issue ? |
I have added multiple file and multi folder support and opened a merge request. See #121 |
I love the idea of a central repository that pet automatically pulls from, but can imagine it will be extremely difficult to pull of.
If you can help find solutions to all of these then we can do this 😅 I like @helmecke 's approach, give power to the user, can specify multiple places to pull from. Is still increasing attack surface but at least we wouldn't be responsible for it? |
actually, what other similar projects like intellishell, marker does is, use tldr as a snippet sharing platform... it's already contains a lot of useful snippets and people always share it, and has support of multiple languages... |
@Vaisakhkm2625 That is so interesting... Thanks for sharing! Haven't heard of it until now. I think we can definitely support that if people are interested in having it as an extra source. I think this can also be designed to be generic so as to support multiple such sources with a "sync" command. Each would have it's own data fetching method + serialization into pet format. I like this now, builds on top of @helmecke 's suggestion while still meeting the need for an optional 'central repository'. |
Actually, i already made a quick python script for converting all of those into a format pet understands, (thanks to intelisense project, i jist converted their rust code to python, and changed the regex to match pet's). It generated over 60k snippets, 😕 and pet search taking 7-8 sec to search it in my laptop and searchs are itself unusable in fzf, as it is not key word based search, but rather fuzzy search that keeps order |
2024-02-27.04-12-12.mp4now that i tested it again, it's fine... tough i should try changing fzf for something else... in this case, such a central repository make sense... |
Wow that's pretty good! @Vaisakhkm2625 Not slow at all 😄 |
Hi, thanks for this great tool. I was thinking the similar thing before finding it. However I feel a strong need to have a central snippet repository so that we could be more productive and learn cool one liners from community. Is there already some existing? What do you think? 😄
The text was updated successfully, but these errors were encountered: