TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A 220b spreadsheet app in HTML/JS

365 pointsby akras14over 7 years ago

27 comments

xemover 7 years ago
Hello World,<p>I&#x27;m xem, author of this mini app, but standing on the shoulders of giants:<p>it&#x27;s inspired by <a href="http:&#x2F;&#x2F;aem1k.com&#x2F;sheet&#x2F;" rel="nofollow">http:&#x2F;&#x2F;aem1k.com&#x2F;sheet&#x2F;</a><p>which was inspired by <a href="http:&#x2F;&#x2F;jsfiddle.net&#x2F;ondras&#x2F;hYfN3&#x2F;" rel="nofollow">http:&#x2F;&#x2F;jsfiddle.net&#x2F;ondras&#x2F;hYfN3&#x2F;</a><p>Cheers to all the JS codegolf team who teached me this noble art and continue to learn new tricks everyday with me!<p>You can find a list of all our mini apps here: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;xem&#x2F;206db44adbdd09bac424" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;xem&#x2F;206db44adbdd09bac424</a>
评论 #15358441 未加载
评论 #15357181 未加载
zestypingover 7 years ago
Initially, I wa puzzled by how the grid could be showing placeholders (the grey &quot;A1&quot;, &quot;A2&quot;, etc.) when there&#x27;s no placeholder attribute defined in the source code. Then I discovered that the code running in the demo is not actually the showcased 220-byte source code at all. The code is still impressively small, but you should fix this — it&#x27;s misleading as is.
评论 #15355669 未加载
tombhover 7 years ago
There&#x27;s a nice comment from the author in an AMA about how this project contained one of his best coding moments: <a href="https:&#x2F;&#x2F;github.com&#x2F;xem&#x2F;ama&#x2F;issues&#x2F;14#issuecomment-123275496" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;xem&#x2F;ama&#x2F;issues&#x2F;14#issuecomment-123275496</a>
评论 #15355574 未加载
warentover 7 years ago
Judging by some of the comments one can regularly find on HN about the size of apps, this may be considered a pinnacle internet technology to be standardized mainstream<p>Tongue in cheek aside, very creative code. Thank you for sharing
评论 #15358692 未加载
odenscover 7 years ago
If we&#x27;re using ES2015, why not save a byte?<p><pre><code> &lt;script&gt;(o=b=&gt;{for(j in a)for(i in a)y=a[i]+-~j,b?document.write([[&quot;&lt;p&gt;&quot;][i]]+`&lt;input onfocus=value=[o[id]] onblur=o[id]=value;o() id=${y}&gt;`):eval(y+(&quot;.value&quot;+o[y]).replace(&#x2F;[A-Z]\d&#x2F;g,&quot; +$&amp;.value&quot;))})(a=&quot;ABCD&quot;)&lt;&#x2F;script&gt;</code></pre>
评论 #15357616 未加载
murftownover 7 years ago
If, like me, you&#x27;re trying to figure out how this works, I&#x27;ve expanded it here to make it more readable:<p><a href="https:&#x2F;&#x2F;pastebin.com&#x2F;1c72BYK1" rel="nofollow">https:&#x2F;&#x2F;pastebin.com&#x2F;1c72BYK1</a>
评论 #15355857 未加载
HumanDrivenDevover 7 years ago
Awesome Job. Looks like it was an iterative effort<p><a href="https:&#x2F;&#x2F;github.com&#x2F;xem&#x2F;ama&#x2F;issues&#x2F;14" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;xem&#x2F;ama&#x2F;issues&#x2F;14</a>
spectaclepieceover 7 years ago
Yesterday I was blown away by both tetris and snake golfed out to this degree and now this. I feel like this is the modern reincarnation of obfuscated c.<p>Can somebody explain to me how: &quot;a[i]+-~j&quot; is the same as &quot;a[i]+(j+1)&quot; ?
评论 #15355937 未加载
darth_mastahover 7 years ago
I hate to say that, but I just seem to have broken it. Here&#x27;s how: I put 0.1 in A1, 0.2 in A2 and =A1+A2 in B1. Now B1 displays &quot;=A1+A2&quot; instead of the result.
评论 #15358528 未加载
MosheZadaover 7 years ago
=1;alert(&quot;Hi&quot;)
评论 #15355406 未加载
评论 #15355395 未加载
评论 #15355352 未加载
评论 #15355531 未加载
评论 #15355567 未加载
评论 #15355326 未加载
spepsover 7 years ago
Fits in a tweet!
评论 #15355620 未加载
52-6F-62over 7 years ago
I was wondering and wondering why it wasn&#x27;t working for me. Colons break the script. I tried to write &quot;TOTAL:&quot; in a cell and none of the equations would resolve. I wanted in on the fun and I didn&#x27;t get it until I relented and checked the console. :P<p>Pretty fun, though
leni536over 7 years ago
Reminds me of an IOCCC entry.<p><a href="http:&#x2F;&#x2F;www0.us.ioccc.org&#x2F;years.html#2000_jarijyrki" rel="nofollow">http:&#x2F;&#x2F;www0.us.ioccc.org&#x2F;years.html#2000_jarijyrki</a>
thinbeigeover 7 years ago
Super impressive and I love code-golfing but the title is slighlty misleading since the HTML part of the app, the cells, seem not to be included in the 220b. Still great.
评论 #15355854 未加载
replerover 7 years ago
And you didn&#x27;t need a dozen node.js modules!! Amazing!!
aalnover 7 years ago
This is awesome, are you planning to add more features like complex functions that are minimally sized?
评论 #15358481 未加载
fabxlover 7 years ago
The bad part of eval: insert `;alert(&quot;test&quot;)` in a used cell by a formula.
ameliusover 7 years ago
Didn&#x27;t know minimizers were <i>this</i> good today ;)<p>Well done!
评论 #15356376 未加载
评论 #15355835 未加载
zichyover 7 years ago
Reminds me of the HTML-only MTG life counter I made:<p><a href="http:&#x2F;&#x2F;zichy.de&#x2F;public&#x2F;counter.html" rel="nofollow">http:&#x2F;&#x2F;zichy.de&#x2F;public&#x2F;counter.html</a> (437b)
icantrankover 7 years ago
aint nobody wana write caps tho
sparakerover 7 years ago
I learned the neat trick of -~<p>Thanks!
tcperover 7 years ago
Great app!
ubersoldat2k7over 7 years ago
Doesn&#x27;t work with decimals.
评论 #15355451 未加载
评论 #15355579 未加载
projectantover 7 years ago
I&#x27;m concerned about the lack of type annotations. What about XSS prevention? Maintainability? An API? How are people supposed to use this code in future projects? Your variable names don&#x27;t conform to Code Complete. This code smells funny. Haven&#x27;t you read clean code? And I don&#x27;t think it&#x27;s general enough. What if people want to add columns, but preserve formulas? What made you think you shouldn&#x27;t use React for this? At least Vue, come on.<p><i>ah, if only we could all code just what we needed, instead of over-engineering solutions to problems we wished we had</i>
评论 #15356002 未加载
评论 #15356013 未加载
评论 #15357213 未加载
评论 #15355972 未加载
评论 #15357428 未加载
评论 #15357024 未加载
评论 #15356662 未加载
评论 #15361767 未加载
patanjaover 7 years ago
wow. thats what I was looking for
datpuzover 7 years ago
Why
评论 #15355310 未加载
评论 #15355263 未加载
评论 #15355522 未加载
评论 #15355299 未加载
mbertschlerover 7 years ago
Yet our browsers blow the page up to 100 or 1000 times that.
评论 #15355315 未加载