Coding conventions
How to get code in and out of Emerald
Downloading from the Emerald Cloud Lab library:
We offer two methods to interact with the Emerald Cloud Lab codebase:
Option 1: Load the code from the links below directly into Command Center
- Click on the provided link, and it will open in a separate tab.
- On the top of the page, you will find a button that allows you to save the page directly into Command Center.
Option 2: Import .m Files from the GitHub Library into Command Center. The github repo can be found at https://github.com/Cloud-Lab-Commons/ecl
- Access the GitHub library containing the .m files.
- Choose the specific .m file you wish to use.
- Import the selected .m file into Command Center.
Adding code to the Cloud Lab library:
We encourage users to adopt an “early and often” approach when committing code. It is advisable to make frequent commits, especially during the development phase to help other users that may be struggling with the same bug.
We suggest utilizing the sandbox folder for code that doesn’t quite work, and the pages, scripts, & functions folder for debugged code.
Steps to use the code are below.
- Clone the Repository: Go to the GitHub repository URL: https://github.com/Cloud-Lab-Commons/ecl
- Start with coding with templates: The page, script and function templates are designed to ensure good coding practices such as explaining functionality and deleting old samples.
- Export your files: Modify the code on your local machine using Emerald Cloud Lab command center.
- Stage Changes: Move the .m file you want to commit to the appropriate folder and type “git add <your .m file>”.
- Commit Changes: Create a snapshot of your changes with a description using the “git commit -m <information about your change>” command.
- Push Changes: Upload your committed changes back to the GitHub repository with “git push.”
That’s it! You’ve successfully checked in your code!