Show HN: Scratch.js – Interactive JavaScript Scratchpad
1–10 of 69 posts
Re: Show HN: Scratch.js – Interactive JavaScript Scratchpad
#2Re: Show HN: Scratch.js – Interactive JavaScript Scratchpad
#3Re: Show HN: Scratch.js – Interactive JavaScript Scratchpad
#4Re: Show HN: Scratch.js – Interactive JavaScript Scratchpad
#5When you paste something it keeps the formatting, intended?
Re: Show HN: Scratch.js – Interactive JavaScript Scratchpad
#6Can you give us Mac users some love and replace ctrl w/ command ? My muscle memory is giving me a hard time xD
Re: Show HN: Scratch.js – Interactive JavaScript Scratchpad
#7Cool stuff! What was the reason for you to make this?
I'm also former Emacs user, and I like the lisp scratch buffer there, which is similar.
Re: Show HN: Scratch.js – Interactive JavaScript Scratchpad
#8Can you give us Mac users some love and replace ctrl w/ command ? My muscle memory is giving me a hard time xD
The source is very small and can be used both through the file:// and hosted http protocols. So you can easily make it do whatever you like. I could maybe expose some global variables to make it customizable, but I went for simplicity and smaller source instead.
`document.addEventListener('keydown', (e) => (e.metaKey && e.code === 'Enter' && evaluate() && e.preventDefault()));`
The metaKey[1] is only accessible for keydown.
[1] https://stackoverflow.com/questions/3902635/how-does-one-cap...
Re: Show HN: Scratch.js – Interactive JavaScript Scratchpad
#9Re: Show HN: Scratch.js – Interactive JavaScript Scratchpad
#10Cool stuff! What was the reason for you to make this?
I find myself opening and using the web console to do simple tasks like string manipulation, maths, sorting often. I wanted a dedicated and persistent way to do this. And also just a place to keep notes, urls and stuff. So I made this "literate programming" notepad. I'm also former Emacs user, and I like the lisp scratch buffer there, which is similar.