Clever! Use of `i--` in loop for condition check wasn't intuitive at first. Apparently `i--` will return the current value of i (before decrementing).
An HTML/CSS/JS code editor in 230+ bytes
11–20 of 57 posts
Re: An HTML/CSS/JS code editor in 230+ bytes
#12Awesome. I love small things. In fact, I created a CSS library, min, that's 995 bytes - http://minfwk.com/ .
Re: An HTML/CSS/JS code editor in 230+ bytes
#13Clever! Use of `i--` in loop for condition check wasn't intuitive at first. Apparently `i--` will return the current value of i (before decrementing).
Re: An HTML/CSS/JS code editor in 230+ bytes
#14 data:text/html,%20for(i=4;i--;)e.innerHTML+=(i?'"+t1[v]+""+t2[v])\'>'
Taken from this: https://coderwall.com/p/lhsrcqRe: An HTML/CSS/JS code editor in 230+ bytes
#15========== 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 ==========
Re: An HTML/CSS/JS code editor in 230+ bytes
#16Clever! Use of `i--` in loop for condition check wasn't intuitive at first. Apparently `i--` will return the current value of i (before decrementing).
Not intuitive? What do you think a post-decrement does do if not that?
for(i=4;i--;)
instead of the more common (off by one?)
for(i=4; i > 0; i--) syntax
Re: An HTML/CSS/JS code editor in 230+ bytes
#17Copy & 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 also thought of this approach this morning, but didn't mention it because I thought people would just add the editor in their bookmarks.
Re: An HTML/CSS/JS code editor in 230+ bytes
#18Clever! Use of `i--` in loop for condition check wasn't intuitive at first. Apparently `i--` will return the current value of i (before decrementing).
Re: An HTML/CSS/JS code editor in 230+ bytes
#19Re: An HTML/CSS/JS code editor in 230+ bytes
#20Nice 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.
I've made something in this manner recently: http://tinyurl.com/selfcontained-editable-datauri