{"id":16516694,"url":"https://github.com/adamspannbauer/quinep5js","last_synced_at":"2025-03-02T18:19:07.980Z","repository":{"id":83432211,"uuid":"410225213","full_name":"AdamSpannbauer/quineP5js","owner":"AdamSpannbauer","description":"A program that writes itself... artistically ✨🎨✨","archived":false,"fork":false,"pushed_at":"2021-09-28T08:47:28.000Z","size":604,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T05:28:32.279Z","etag":null,"topics":["generative-art","p5js","quine"],"latest_commit_sha":null,"homepage":"https://adamspannbauer.github.io/quineP5js/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AdamSpannbauer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-25T09:04:39.000Z","updated_at":"2021-09-28T08:47:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"77bd592a-f889-447a-8430-b35a192bf63c","html_url":"https://github.com/AdamSpannbauer/quineP5js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamSpannbauer%2FquineP5js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamSpannbauer%2FquineP5js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamSpannbauer%2FquineP5js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamSpannbauer%2FquineP5js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdamSpannbauer","download_url":"https://codeload.github.com/AdamSpannbauer/quineP5js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241549116,"owners_count":19980476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generative-art","p5js","quine"],"created_at":"2024-10-11T16:26:10.391Z","updated_at":"2025-03-02T18:19:07.960Z","avatar_url":"https://github.com/AdamSpannbauer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Quine Design in p5js\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"readme/exampleOutput.svg\" width=\"75%\" /\u003e\n\u003c/p\u003e\n\nFrom [Wikipedia](\u003chttps://en.wikipedia.org/wiki/Quine_(computing)\u003e):\n\n\u003e A quine is a computer program which takes no input and produces a copy of its own source code as its only output. The standard terms for these programs in the computability theory and computer science literature are \"self-replicating programs\", \"self-reproducing programs\", and \"self-copying programs\".\n\nThis project's goal was to have a `sketch.js` file output itself to an html canvas. And as someone who uses the #generativeart tag on Instagram, I couldn't resist adding in some `noise()` to the output characters.\n\n## How it works\n\nTo be upfront, I'm a javascript hobbyist ([my resume](https://docs.google.com/document/d/1Io4LEHVON8k9PaJNFVVoO_5M0CFdDCosaM-xzAp5MEQ/edit?usp=sharing) if you're hiring 👀), so I'm lacking some formal training. I'm not sure if I built the best way to do this, or if I jumped through some extra hoops. Regardless, I had fun and was able to learn about a very useful VSCode extension.\n\n### Run on Save VSCode extension\n\nThe main workhorse of the whole process is found in [.vscode/settings.json](.vscode/settings.json). The [Run on Save](https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave) extension does the rest.\n\nWith the below configuration, everytime the file `sketch.js` is saved, a python script is run. This python script copys the contents of `sketch.js` to a string variable. This string is then read by `sketch.js` (i.e. it's reading itself).\n\n```json\n{\n  \"emeraldwalk.runonsave\": {\n    \"commands\": [\n      {\n        \"match\": \"sketch.js\",\n        \"cmd\": \"./copyFileToVar.py\"\n      }\n    ]\n  }\n}\n```\n\n### The p5js sketch\n\nI won't comment too much on the sketch itself. The workhorse functions are all fairly documented (esp by side project standards).\n\nNote some of the coding decisions in `sketch.js` were made for design reasons rather than best practices.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamspannbauer%2Fquinep5js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamspannbauer%2Fquinep5js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamspannbauer%2Fquinep5js/lists"}