Discussion:
Gambas Playground
(too old to reply)
Adrien Prokopowicz
2017-07-15 23:37:04 UTC
Permalink
Hello Everyone !

These past few days I had fun putting together an online playground for
Gambas !
You can find it here : https://gambas-playground.proko.eu/ :)

The playground is a little place to write and run Gambas code snippets,
which I
think could be very useful in the mailing-list where codes flies around
everywhere. :)

You can also directly share a link of your code in the playground using the
"Share" button, which will generate a link like this :

https://gambas-playground.proko.eu/?gist=07db52169ef8b747d26f8bee4a4a19e9

The code is actually stored in a GitHub Gist, rather than in the playground
itself, which makes it completely stateless.

Of course, since this is a web service (i.e. not your computer ! :) ),
there are
a few limitations :

- Your code cannot run for more than 2 seconds, or it will get SIGKILL'd
- It cannot use more than 16 megabytes of RAM (it segfaults if you use too
much)
- You cannot make any network access whatsoever (there are no network
cards,
and the process does not have permission to open sockets).
- You *can* read, write or delete any file, but all changes to the
filesystem
are discarded when the process ends.
- There are probably a few edge cases I didn't think of, so please don't
abuse
it. :)

However, a few components are available, just add the USE instruction to
load
it, just like you would in a Gambas script. Here is an example :

https://gambas-playground.proko.eu/?gist=8a49aae5f5e24569c3f7f7e55c619f05

The following components are available in the playground :

gb.args, gb.clipper, gb.complex, gb.compress, gb.data, gb.debug, gb.draw,
gb.eval, gb.eval.highlight, gb.geom, gb.image.effect, gb.image,
gb.inotify,
gb.markdown, gb.option, gb.settings, gb.signal, gb.term, gb.util,
gb.util.web,
gb.vb, gb.xml, gb.xml.html

(Basically, any component that doesn't depend on networking or GUI, tell
me if
any is missing :) )

Behind the scenes, it is a simple Gambas application serving a REST API,
which takes the code as input. It then spins up a Docker container, which
has
a simple "runner" Gambas application as its init process, which takes the
code,
feeds it to the Gambas Scripter (gbs3) and then returns its output.

The app is still a bit rough on the edges (for instance, I should make a
proper
Gambas highlighter for the editor, instead of using the VBScript one :p),
but I think it is good enough to see some use.

Tell me if you have some ideas to improve it, and have fun with it ! :)
--
Adrien Prokopowicz
Karl Reinl
2017-07-16 09:11:40 UTC
Permalink
Post by Adrien Prokopowicz
Hello Everyone !
These past few days I had fun putting together an online playground for
Gambas !
You can find it here : https://gambas-playground.proko.eu/ :)
The playground is a little place to write and run Gambas code snippets,
which I
think could be very useful in the mailing-list where codes flies around
everywhere. :)
You can also directly share a link of your code in the playground using the
https://gambas-playground.proko.eu/?gist=07db52169ef8b747d26f8bee4a4a19e9
The code is actually stored in a GitHub Gist, rather than in the playground
itself, which makes it completely stateless.
Of course, since this is a web service (i.e. not your computer ! :) ),
there are
- Your code cannot run for more than 2 seconds, or it will get SIGKILL'd
- It cannot use more than 16 megabytes of RAM (it segfaults if you use too
much)
- You cannot make any network access whatsoever (there are no network
cards,
and the process does not have permission to open sockets).
- You *can* read, write or delete any file, but all changes to the
filesystem
are discarded when the process ends.
- There are probably a few edge cases I didn't think of, so please don't
abuse
it. :)
However, a few components are available, just add the USE instruction to
load
https://gambas-playground.proko.eu/?gist=8a49aae5f5e24569c3f7f7e55c619f05
gb.args, gb.clipper, gb.complex, gb.compress, gb.data, gb.debug, gb.draw,
gb.eval, gb.eval.highlight, gb.geom, gb.image.effect, gb.image,
gb.inotify,
gb.markdown, gb.option, gb.settings, gb.signal, gb.term, gb.util,
gb.util.web,
gb.vb, gb.xml, gb.xml.html
(Basically, any component that doesn't depend on networking or GUI, tell
me if
any is missing :) )
Behind the scenes, it is a simple Gambas application serving a REST API,
which takes the code as input. It then spins up a Docker container, which
has
a simple "runner" Gambas application as its init process, which takes the
code,
feeds it to the Gambas Scripter (gbs3) and then returns its output.
The app is still a bit rough on the edges (for instance, I should make a
proper
Gambas highlighter for the editor, instead of using the VBScript one :p),
but I think it is good enough to see some use.
Tell me if you have some ideas to improve it, and have fun with it ! :)
Salut Adrien,

now we can discuss 'Best ways to format float values' like this

look here you can test Nando's way

https://gambas-playground.proko.eu/?gist=037e17d22f3ac93cd3da3d6ad681f713

Thanks
--
Amicalement
Charlie
Gianluigi
2017-07-16 13:10:55 UTC
Permalink
Thanks Adrien,
I was able to mistake my first insertion (I left useless code) :(.
Can I fix it? [0]

Regards
Gianluigi

[0]
http://gambas.8142.n7.nabble.com/Best-ways-to-format-float-values-td59733.html
Post by Adrien Prokopowicz
Post by Adrien Prokopowicz
Hello Everyone !
These past few days I had fun putting together an online playground for
Gambas !
You can find it here : https://gambas-playground.proko.eu/ :)
The playground is a little place to write and run Gambas code snippets,
which I
think could be very useful in the mailing-list where codes flies around
everywhere. :)
You can also directly share a link of your code in the playground using
the
Post by Adrien Prokopowicz
https://gambas-playground.proko.eu/?gist=07db52169ef8b747d26f8bee4a4a19
e9
Post by Adrien Prokopowicz
The code is actually stored in a GitHub Gist, rather than in the
playground
Post by Adrien Prokopowicz
itself, which makes it completely stateless.
Of course, since this is a web service (i.e. not your computer ! :) ),
there are
- Your code cannot run for more than 2 seconds, or it will get SIGKILL'd
- It cannot use more than 16 megabytes of RAM (it segfaults if you use
too
Post by Adrien Prokopowicz
much)
- You cannot make any network access whatsoever (there are no network
cards,
and the process does not have permission to open sockets).
- You *can* read, write or delete any file, but all changes to the
filesystem
are discarded when the process ends.
- There are probably a few edge cases I didn't think of, so please don't
abuse
it. :)
However, a few components are available, just add the USE instruction to
load
https://gambas-playground.proko.eu/?gist=8a49aae5f5e24569c3f7f7e55c619f
05
Post by Adrien Prokopowicz
gb.args, gb.clipper, gb.complex, gb.compress, gb.data, gb.debug,
gb.draw,
Post by Adrien Prokopowicz
gb.eval, gb.eval.highlight, gb.geom, gb.image.effect, gb.image,
gb.inotify,
gb.markdown, gb.option, gb.settings, gb.signal, gb.term, gb.util,
gb.util.web,
gb.vb, gb.xml, gb.xml.html
(Basically, any component that doesn't depend on networking or GUI, tell
me if
any is missing :) )
Behind the scenes, it is a simple Gambas application serving a REST API,
which takes the code as input. It then spins up a Docker container, which
has
a simple "runner" Gambas application as its init process, which takes the
code,
feeds it to the Gambas Scripter (gbs3) and then returns its output.
The app is still a bit rough on the edges (for instance, I should make a
proper
Gambas highlighter for the editor, instead of using the VBScript one :p),
but I think it is good enough to see some use.
Tell me if you have some ideas to improve it, and have fun with it ! :)
Salut Adrien,
now we can discuss 'Best ways to format float values' like this
look here you can test Nando's way
https://gambas-playground.proko.eu/?gist=037e17d22f3ac93cd3da3d6ad681f713
Thanks
--
Amicalement
Charlie
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Adrien Prokopowicz
2017-07-16 14:03:26 UTC
Permalink
Post by Gianluigi
Thanks Adrien,
I was able to mistake my first insertion (I left useless code) :(.
Can I fix it? [0]
Regards
Gianluigi
[0]
http://gambas.8142.n7.nabble.com/Best-ways-to-format-float-values-td59733.html
Hi Gianluigi,

You can't edit anonymous Gists once they are created, but a bit of extra
code is
no big deal, you can just edit your code in the playground and generate a
new link.
(GitHub has plenty of storage space. :) )

As a side note, if you happen to accidentally share sensitive data inside
a code link
(such as passwords), you can contact the GitHub team[0] and ask them to
delete it.
The playground itself does not store anything, so you don't need to worry
about it.

If, in the future, you want to share some code on the playground and be
able to edit
it later, you can log in in GitHub, create a Gist from there and then
manually craft
a link to the playground like this :
https://gambas-playground.proko.eu/?gist=your_gist_id_here

Hope this helps. :)

[0] https://help.github.com/articles/deleting-an-anonymous-gist/
--
Adrien Prokopowicz
Gianluigi
2017-07-16 14:32:48 UTC
Permalink
Hi Adrien,

Thank you very much for the detailed answer.
Now I know how to behave the next time I'm wrong :)

Regards
Gianluigi
Post by Gianluigi
Thanks Adrien,
Post by Gianluigi
I was able to mistake my first insertion (I left useless code) :(.
Can I fix it? [0]
Regards
Gianluigi
[0]
http://gambas.8142.n7.nabble.com/Best-ways-to-format-float-v
alues-td59733.html
Hi Gianluigi,
You can't edit anonymous Gists once they are created, but a bit of extra
code is
no big deal, you can just edit your code in the playground and generate a
new link.
(GitHub has plenty of storage space. :) )
As a side note, if you happen to accidentally share sensitive data inside
a code link
(such as passwords), you can contact the GitHub team[0] and ask them to
delete it.
The playground itself does not store anything, so you don't need to worry
about it.
If, in the future, you want to share some code on the playground and be
able to edit
it later, you can log in in GitHub, create a Gist from there and then
manually craft
https://gambas-playground.proko.eu/?gist=your_gist_id_here
Hope this helps. :)
[0] https://help.github.com/articles/deleting-an-anonymous-gist/
--
Adrien Prokopowicz
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
PICCORO McKAY Lenz
2017-07-18 23:50:08 UTC
Permalink
good made it! its good to know more and more of gambas are happened

two things>

1) the playground seems only applies most to gambas scripts rather thant
other gambas things
2) wheres its the code that generates the service, i mean url post here!

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
Post by Gianluigi
Hi Adrien,
Thank you very much for the detailed answer.
Now I know how to behave the next time I'm wrong :)
Regards
Gianluigi
2017-07-16 16:03 GMT+02:00 Adrien Prokopowicz <
Post by Gianluigi
Thanks Adrien,
Post by Gianluigi
I was able to mistake my first insertion (I left useless code) :(.
Can I fix it? [0]
Regards
Gianluigi
[0]
http://gambas.8142.n7.nabble.com/Best-ways-to-format-float-v
alues-td59733.html
Hi Gianluigi,
You can't edit anonymous Gists once they are created, but a bit of extra
code is
no big deal, you can just edit your code in the playground and generate a
new link.
(GitHub has plenty of storage space. :) )
As a side note, if you happen to accidentally share sensitive data inside
a code link
(such as passwords), you can contact the GitHub team[0] and ask them to
delete it.
The playground itself does not store anything, so you don't need to worry
about it.
If, in the future, you want to share some code on the playground and be
able to edit
it later, you can log in in GitHub, create a Gist from there and then
manually craft
https://gambas-playground.proko.eu/?gist=your_gist_id_here
Hope this helps. :)
[0] https://help.github.com/articles/deleting-an-anonymous-gist/
--
Adrien Prokopowicz
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Adrien Prokopowicz
2017-07-19 02:38:41 UTC
Permalink
Le Wed, 19 Jul 2017 01:50:08 +0200, PICCORO McKAY Lenz
Post by PICCORO McKAY Lenz
good made it! its good to know more and more of gambas are happened
two things>
1) the playground seems only applies most to gambas scripts rather thant
other gambas things
2) wheres its the code that generates the service, i mean url post here!
Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
I'm not sure I can understand you correctly, but I'll try my best. :)

If by "other gambas things" you mean "full projects", then yes, the
playground
is only intended to run Gambas scripts, since it is designed for quick
tests and prototyping, and sharing/running code on Gambas mailing-lists and
forums.
But since Gambas scripts are no different from a regular project (except
that
every class/module is in a single file), I don't see how it is a problem.

And for the code, I just pushed it to a GitLab repository. You'll find it
here :
https://gitlab.com/prokopyl/gambas-playground

Regards,
--
Adrien Prokopowicz
PICCORO McKAY Lenz
2017-07-19 10:11:39 UTC
Permalink
Post by Adrien Prokopowicz
I'm not sure I can understand you correctly, but I'll try my best. :)
yes your are right, sorry for my english
Post by Adrien Prokopowicz
If by "other gambas things" you mean "full projects", then yes, the
playground
is only intended to run Gambas scripts, since it is designed for quick
tests and prototyping, and sharing/running code on Gambas mailing-lists and
forums.
But since Gambas scripts are no different from a regular project (except
that
every class/module is in a single file), I don't see how it is a problem.
its not a problem, its only to clarify, and its make sense due GUI are
difficult to "lauch" from web..
Post by Adrien Prokopowicz
And for the code, I just pushed it to a GitLab repository. You'll find it
https://gitlab.com/prokopyl/gambas-playground
good made, better than the old-comlex svn.. thanks
Post by Adrien Prokopowicz
Regards,
--
Adrien Prokopowicz
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
PICCORO McKAY Lenz
2017-07-19 10:15:43 UTC
Permalink
Post by PICCORO McKAY Lenz
Post by Adrien Prokopowicz
And for the code, I just pushed it to a GitLab repository. You'll find it
https://gitlab.com/prokopyl/gambas-playground
good made, better than the old-comlex svn.. thanks
i found seeds and some traces, but have private non-opensource repositoryes
in both github and gilab, please be share/open

does not gambas are open/free software for you ? give same back to
community .. thanks in advance!
Post by PICCORO McKAY Lenz
Post by Adrien Prokopowicz
Regards,
--
Adrien Prokopowicz
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Adrien Prokopowicz
2017-07-19 13:03:35 UTC
Permalink
Le Wed, 19 Jul 2017 12:15:43 +0200, PICCORO McKAY Lenz
Post by PICCORO McKAY Lenz
Post by PICCORO McKAY Lenz
Post by Adrien Prokopowicz
And for the code, I just pushed it to a GitLab repository. You'll find it
https://gitlab.com/prokopyl/gambas-playground
good made, better than the old-comlex svn.. thanks
i found seeds and some traces, but have private non-opensource
repositoryes
in both github and gilab, please be share/open
does not gambas are open/free software for you ? give same back to
community .. thanks in advance!
The repository I linked was indeed private, that was not intended.
It is now fixed, everyone should now be able to access it.

Regards,
--
Adrien Prokopowicz
PICCORO McKAY Lenz
2017-07-19 13:14:15 UTC
Permalink
a docker to take more overall control to the env (also due to put a good
necesary gambas env). good idea (and i not avocate to doker containers.. )

some js are minified make very dificult understand and study the code
(special for those that are not experts)

as i understand setup a minimal env/docker with gambas, the make a
copy/instance of playground-runner and then that runner paly a server
playground that server the web interface.. ?


Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
Le Wed, 19 Jul 2017 12:15:43 +0200, PICCORO McKAY Lenz <
Post by PICCORO McKAY Lenz
Post by Adrien Prokopowicz
And for the code, I just pushed it to a GitLab repository. You'll find it
Post by Adrien Prokopowicz
https://gitlab.com/prokopyl/gambas-playground
good made, better than the old-comlex svn.. thanks
i found seeds and some traces, but have private non-opensource
repositoryes
in both github and gilab, please be share/open
does not gambas are open/free software for you ? give same back to
community .. thanks in advance!
The repository I linked was indeed private, that was not intended.
It is now fixed, everyone should now be able to access it.
Regards,
--
Adrien Prokopowicz
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Continue reading on narkive:
Loading...