Skip to content

Instantly share code, notes, and snippets.

@ohAitch
Last active January 28, 2018 15:36
Show Gist options
  • Save ohAitch/da2765f963a2ce6cea30c572cb2c2a9b to your computer and use it in GitHub Desktop.
Save ohAitch/da2765f963a2ce6cea30c572cb2c2a9b to your computer and use it in GitHub Desktop.
"IDE"
<body>
<script src="https://code.jquery.com/jquery.js"></script>
<pre id="boot" contenteditable style="background:#eea">inp.onkeyup = inp.onfocus = () =&gt; {
var a
try{ a = eval(inp.innerText)} catch(_a){ a = _a}
res.innerText = a
}</pre>
<pre id="inp" contenteditable style="background:#bdb">
localStorage.setItem("image", document.body.innerHTML)
1+1
</pre>
<pre id="res">...</pre>
<script>
document.body.innerHTML = localStorage.getItem("image") || document.body.innerHTML
eval(boot.innerText)
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment