GitHub Gists Sharing code snippets

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
AndyP
Posts: 614
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

GitHub Gists Sharing code snippets

Post by AndyP » Sat Nov 26, 2022 6:52 pm

I have code snippets all over the place and am now trying to better organize all of them.

So I'm in the process of building a utility to access my public gists at GitHub "Gists Book". This uses a app token to allow access to GitHubs api, nice and simple.

At the moment I can list, add new and edit my gists via the app but I was thinking that perhaps if there is enough interest this could be expanded to provide an open snippet facility for all?

My thoughts are that I could create an online db wich could be accessed via the Gist Book app allowing users to upload their gists for sharing.
The db gists would be able to be listed and imported into Gist Book for use in LiveCode.

This is a screenshot of where I am at the moment, as you can its definitely a work in progress.

I'm happy to host the db for the project.

Interested on ideas and features...what do you think about this?
Attachments
Screenshot 2022-11-26 182918.png
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

stam
Posts: 2635
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: GitHub Gists Sharing code snippets

Post by stam » Sat Nov 26, 2022 7:17 pm

Looks good Andy - as it happens was working on something similar although still just in SQLite -- but been thinking of gist or hosting my own (as I don't think the gist API directly lets you search public gists for terms like 'livecodescript'.
Screenshot;
snippetManager.jpg


Considering online sharing, I was thinking a user would need 'private' snippets that are stored locally and 'public' snippets that would be shared online; a way to search online for snippets but allow read-only access only, with the option to add to private collection if not the owner of the snippet.

Ideally there would be a way to search gist for 'livecode' or some such but not sure if the API allows this (after a brief look, I don't think it does)
Was considering just adding this to my liveCloud account and open it up if people want to use this to share snippets, we'll see...

Stam
Last edited by stam on Sun Nov 27, 2022 6:42 am, edited 1 time in total.

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 257
Joined: Sat Aug 16, 2008 9:48 am
Location: Stockholm, Sweden
Contact:

Re: GitHub Gists Sharing code snippets

Post by SWEdeAndy » Sat Nov 26, 2022 8:13 pm

A very good idea and initiative, Andy!

From time to time I 'rediscover' the stack called MasterLibrary by Michael Doub, which might not have been updated for a few years but still has loads of great script snippets in it. Maybe the content of that stack could be transferred to your db later on?

I don't know how to find it other than googling it, which gives you this old use-list post, where you can find a download link:
https://use-livecode.runrev.narkive.com ... able#post2
Andreas Bergendal
Independent app and system developer
WhenInSpace: https://wheninspace.se

stam
Posts: 2635
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: GitHub Gists Sharing code snippets

Post by stam » Sat Nov 26, 2022 9:19 pm

Thanks for sharing that Andreas.
Interesting stack - The design is not exactly what I'd go for design-wise (for example I'd prefer not to group scripts in categories - much like Andy I'd prefer to categorise by tag).
There may be some useful scripts in there... although a number of them seem to be 1-liner handler calls. Still, kudos to Michael Doub for sharing this complex stack which has clearly been a labour of love, and for including the scripts as well...

AndyP
Posts: 614
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: GitHub Gists Sharing code snippets

Post by AndyP » Sun Nov 27, 2022 10:26 am

Hi Stam, looks good, nice clean interface.
stam wrote:
Sat Nov 26, 2022 7:17 pm
as it happens was working on something similar although still just in SQLite -- but been thinking of gist or hosting my own (as I don't think the gist API directly lets you search public gists for terms like 'livecodescript'.
Thanks for sharing that Andreas, lots of useful snippets there, will be adding some of these to my gists library.

I will carry on with Gist Book and when ready will add to share and GitHub.
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

Post Reply

Return to “Talking LiveCode”