https://github.com/lukebatchelor/url-snake Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} lukebatchelor / url-snake Public * Notifications * Fork 2 * Star 57 url-snake.netlify.app/ 57 stars 2 forks Star Notifications * Code * Issues 2 * Pull requests 1 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights lukebatchelor/url-snake This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 0 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/l] Use Git or checkout with SVN using the web URL. [gh repo clone lukeba] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @lukebatchelor lukebatchelor Down to 713 ... d62964f Jan 9, 2023 Down to 713 d62964f Git stats * 22 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .vscode Init commit Jan 7, 2023 golf Down to 713 Jan 9, 2023 .gitignore Adds basic mobile compatible version, updates readme with docs for bo... Jan 8, 2023 dev.html Adds footer to built dists with minified code and links Jan 8, 2023 index.html Adds footer to built dists with minified code and links Jan 8, 2023 package.json Updates build script to build new footers Jan 8, 2023 readme.md Down to 713 Jan 9, 2023 run.js Down to 713 Jan 9, 2023 snake1.jpg Updates readme screenshots Jan 8, 2023 snake2.jpg Updates readme screenshots Jan 8, 2023 yarn.lock Init commit Jan 7, 2023 View code URL Snake Result Code golfing Development Building a single file readme.md URL Snake A little experiement with seeing how complex of an app I can store entirely within a url. The basic idea revolves around the fact that a data urls can define their encoding as text/html. i.e data:text/html;charset=utf-8,hello%20world is a valid url (try pasting it in your url bar). So is data:text/html;charset= utf-8,%3Cstyle%3E%20*%20%7B%20color%3A%20red%3B%20%7D%3C%2Fstyle%3EHello%20world!. Aditionally, so is data:text/html;charset= utf-8,%3Cstyle%3E%20*%20%7B%20color%3A%20red%3B%20%7D%3C%2Fstyle%3EHello%20world! %3Cscript%3Ealert(%22hello%20again!%22)%3B%3C%2Fscript%3E. So, if we can put html, css and js in a url and have that render a valid html page, how much of a page could we create? Result I've come up with a [DEL:1033:DEL] [DEL:852:DEL] [DEL:799:DEL] 713 byte solution that is a fully playable game of snake. let e=document.body,t="Space: start/reset. Arrows: Move