Personal solutions for exercises from Nature of Code (github). Runs in p5.js and ProcessingJS since I'm working on a Chromebook and my SSH client does not seem to support X-Forwarding.
Setup:
- Have the repository sitting on a server with SSH, vim and nginx.
- Use the Chromebook to log in over SSH on the server and modify the files using vim.
- Let
inotifywait
rebuild the HTML files whenver solution files are saved - View results in the browser.
How to use:
- Set up nginx to serve static files from a folder of your choosing
- Run
HTML_ROOT=/your/chosen/folder ./generate
- Open
http://<your_ip>/index.html
in a browser
For development it's nice to generate the files as soon as you save your solutions, one way of doing this is by using inotify:
export HTML_ROOT=/your/chosen/folder
while true; do inotifywait --event close_write,ignored --recursive --exclude '^\.' --exclude '~$' solutions/ ; rm "$HTML_ROOT/index.html" ; ./generate ; done