Jump to content

Snippets


Rick
 Share

Recommended Posts

There is a cool site for saving your code snippets. https://snipt.net

 

I created an account and posted my global picking and calling a script function snippet. I tagged it with "Leadwerks".

 

https://snipt.net/search/?q=Leadwerks

 

 

Would be handy if others would make accounts and contribute any snippets they often use. If we get enough maybe Josh could include querying this site for Leadwerks tags in the Lua editor so we can bring up different snippets directly from the editor! Or if he ever makes the editor have a plugin system we could make this feature ourselves. I know there is code that I always have to go outside of the editor and look up.

 

Looks like they assign a GUID to each snippet and in the raw link you get just the code back:

 

https://snipt.net/raw/1070c25779bbfe8655d1a7eb25513d98/

 

Thoughts/Ideas?

 

 

Here is how we'd use their web api to get all tags with Leadwerks returned in XML format: https://snipt.net/api/public/snipt/?q=Leadwerks&format=xml

 

I just picture in the Lua editor we can do a key combination that does this query and returns the results to a dialog box. We pick the one we want and it gets inserted where our cursor was or something like that.

  • Upvote 1
Link to comment
Share on other sites

OK, so I've made a .NET app (windows only atm) that uses their web service that queries the above site for tags of "Leadwerks". It lists the titles out and when you click on a title it shows the code. You can then click a button that'll copy the code into the clipboard for you to paste it into the Lua editor/wherever. Need to tweak it some but this should get the ball rolling.

 

I don't have huge hopes for this because it's not built into the Lua editor and it uses a 3rd party site where anyone can post anything with a Leadwerks tag and it would show up here which for sure would get abused at some point, but maybe it'll show the benefit of it and Josh could consider implementing something like this directly into the Lua editor where the snippets are from the Leadwerks site so they can be better regulated/controlled.

 

Will post more later.

Link to comment
Share on other sites

Although there is some useful information in the old wiki, it has been inactive for over more than 2 years. Josh has stated many times he will not be using it again. It would take an enormous amount of time to clean everything up. Even then you still wouldn't know if all the spam and malicious scripts are gone.

 

Personally I think it is good to have a separate wiki. Josh doesn't have to spend time any time on it and the community has more control over keeping things clean.

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...