Hacker News new | ask | show | jobs
by tuyguntn 414 days ago
> 100% static HTML/JS app.

> under 300 LOC

> "Do nothing" button

WTF mf, why are so many lines and fancy tech for do nothing button?

2 comments

You forced me to stand up and write the code. Here is your cross-platform desktop app in 10 lines, pretty sure others can do better than me:

    package main
    import (
     "fyne.io/fyne/v2/app"
     "fyne.io/fyne/v2/widget"
    )
    func main() {
     w := app.New().NewWindow("One Button App")
     w.SetContent(widget.NewButton("Do Nothing", func() {}))
     w.ShowAndRun()
    }
You only need two Tcl statements, shown here on one line for the sake of this pissing contest:

button .b -text "Do Nothing" -command {exit}; pack .b

Last week we had an entire game of DOOM in a QR code... I think someone can get us "Do nothing" in less than 300 lines of code.
I'm sure someone can get it smaller than this (save as .html)

  <input id="i">
  <button onclick="l.textContent='Now do '+i.value">Do This</button>
  <button onclick="l.textContent='Do nothing'">Do Nothing</button>
  <label id="l"></label>

    data:text/html;,<input id=i><button onclick="l.textContent='Now do '+i.value">Do</button><button onclick="l.textContent='Do nothing'">Nope</button><label id=l>
Will work in your browser if you copy/paste it. Or as a QR code: https://d1yei2z3i6k35z.cloudfront.net/2914/6815454b25323_qr-...