How to share or reuse code?

Hi, what would be the right way for reusing code or sharing a peace of code in Snap!?

You mean "a piece of code", not "a peace".
To share code, you can post your project in the "Share your Projects" or "How To" category in the forums.

XD yes, "piece".
I was referring to whether it was possible to copy and paste pieces of code into other projects so as not to have to rebuild the blocks again.

Hi, welcome to the forum!

If your blocks are global ("For all sprites," which is the default), the easiest thing to do is select "Export blocks" from the file menu in the Snap! toolbar. You then get a list of your blocks in which you can choose which ones to export. (If one block depends on another, be sure to include that other one!)

If the blocks belong to a particular sprite, you can right-click on the sprite's icon in the sprite corral (bottom right corner of the screen) and choose "export."

In either case, you can just drag the downloaded file into another project, or in the other project choose "Import..." from the File menu and choose the file from the system dialog that appears.

Thanks, bh.