Live data from Hacker News

An HTML/CSS/JS code editor in 230+ bytes

xem.github.io

41–50 of 57 posts

Re: An HTML/CSS/JS code editor in 230+ bytes

#41
post #29

Awesome. I love small things. In fact, I created a CSS library, min, that's 995 bytes - http://minfwk.com/ .

Amazing how much you wedged into 995 bytes. I have to admit, I would have been willing to pay 997 or 988 bytes for it, but I'm a big spender ;-)

Woah woah woah, you can't just go around flashing your kilobytes around.

Re: An HTML/CSS/JS code editor in 230+ bytes

#42
post #32

I built a quick responsive front-end for this and re-wrote the JavaScript so the order goes: HTML -> CSS -> JavaScript Github: https://github.com/tomhodgins/liveeditor Screenshot: http://i.imgur.com/SuXoXHb.png Demo: http://staticresource.com/editor

You shouldn't use jQuery, inline CSS and inline JS right before closing tag.

I get the CSS, but why the others?

Re: An HTML/CSS/JS code editor in 230+ bytes

#43
post #42

Earlier quoted context omitted.

You shouldn't use jQuery, inline CSS and inline JS right before closing tag.

I get the CSS, but why the others?

Why do you want to include a huge library if only use is to check if page is ready?

Extra HTTP request has more overhead then few inline bytes.

if you put that code at bottom, you won't need jQuery to know if page is ready, and won't need extra HTTP request.

Re: An HTML/CSS/JS code editor in 230+ bytes

#44
post #7

========== Wow! This topic is successful! You can also take a look at this 512b project that didn't live long on HN yesterday: A minesweeper game https://news.ycombinator.com/item?id=6853868 And my other code golfing projects: http://xem.github.io/?golfing ==========

The attention-grabbing equals symbols come off as spammy and underhanded.

Re: An HTML/CSS/JS code editor in 230+ bytes

#45

Nice and you could probably make it save in under 512 bytes. Just persist everything to localStorage like the tiny spreadsheet http://jsfiddle.net/ondras/hYfN3/ Or save everything on the URL so it can be bookmarked too.

You know, thare's already a save function: you can write stuff in the cross-browser editor and save it on your desktop as a standalone HTML page (Ctrl-S / File > "Save as...")

http://xem.github.io/miniCodeEditor/editor.html

I recommend you to use Firefox: it will keep the code in the textareas. Chrome will only save the iframe's content.

;)

Re: An HTML/CSS/JS code editor in 230+ bytes

#46
post #7

========== Wow! This topic is successful! You can also take a look at this 512b project that didn't live long on HN yesterday: A minesweeper game https://news.ycombinator.com/item?id=6853868 And my other code golfing projects: http://xem.github.io/?golfing ==========

The attention-grabbing equals symbols come off as spammy and underhanded.

You make a lot of blaming statements around here. It may be spammy, but you have no evidence it's underhanded.

Re: An HTML/CSS/JS code editor in 230+ bytes

#47
post #32

I built a quick responsive front-end for this and re-wrote the JavaScript so the order goes: HTML -> CSS -> JavaScript Github: https://github.com/tomhodgins/liveeditor Screenshot: http://i.imgur.com/SuXoXHb.png Demo: http://staticresource.com/editor

made a quick pull request to save you 83kb, silly to include jQuery just for document.ready.

Re: An HTML/CSS/JS code editor in 230+ bytes

#48
Looks like you're setting the 's contents with a data uri in the src attribute, you save some characters if you use the HTML5 srcdoc attribute:

    for(i=4;i--;)e.innerHTML+=(i?'"+t1[v]+""+t2[v]\'>'
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/if...

http://www.whatwg.org/specs/web-apps/current-work/multipage/...

Re: An HTML/CSS/JS code editor in 230+ bytes

#49
post #40
post #14

Copy & paste this in the address bar of your browser in order to use it as inline resource (it's data URI format): data:text/html,%20 for(i=4;i--;)e.innerHTML+=(i?' "+t1[v]+" "+t2[v])\'>' Taken from this: https://coderwall.com/p/lhsrcq

I made one that can let you visit the page in a data uri, and can edit itself awhile ago. I just put it on github. https://news.ycombinator.com/item?id=6862837

That's very nice too!

Re: An HTML/CSS/JS code editor in 230+ bytes

#50
post #48

Looks like you're setting the 's contents with a data uri in the src attribute, you save some characters if you use the HTML5 srcdoc attribute: for(i=4;i--;)e.innerHTML+=(i?' "+t1[v]+" "+t2[v]\'>' https://developer.mozilla.org/en-US/docs/Web/HTML/Element/if... http://www.whatwg.org/specs/web-apps/current-work/multipage/...

Thanks for your help! You shoud join us on Github, and discuss this subject here: https://github.com/xem/miniCodeEditor/issues/6
Post reply on HN