HNHacker News
TopNewBestAskShowJobs

clash

165 karma · joined November 28, 2017

http://framelabs.eu/
submissionscomments
clash··on Caffeine-like utility to keep you MacBook awake with its lid closed
Obviously code-golfed LOC is bullshit. 50 files and GUI for a near-trivial functionality is excessive, though.
clash··on Caffeine-like utility to keep you MacBook awake with its lid closed
Bold accusation ;)

You forgot to argue about the LOC vs file count issue.

Also, you are wrong: None does auto sleep on script exit.

clash··on Caffeine-like utility to keep you MacBook awake with its lid closed
You say "No need to write a tool", then immediately write a tool. Brilliant :)

My first attempt was a shell script almost exactly like yours. Then I thought I want to be able to set SUID so I don't have to use sudo. This ruled out the shell script. I could have just done a bunch of 'system("pmset ...")' calls but thought I might as well use the native commands.

clash··on Caffeine-like utility to keep you MacBook awake with its lid closed
Yeah, most of these repositories contain more files than caffeinate+ has lines of code.

The API call that 'sudo pmset -a disablesleep 1' does is literally the first thing caffeine+ does. But is only part of the full solution: As soon as the lid closes the command is automatically reverted so you can't forget to do it yourself. Also if you kill caffeinate+, the MacBook is put to sleep when the lid is still closed.

clash··on Caffeine-like utility to keep you MacBook awake with its lid closed
Yeah, I obviously also did the research prior to implementing my solution.

I did not want GUI, just super simple caffeinate-like CLI. Also I wanted auto-shutdown afterwards.

clash··on Caffeine-like utility to keep you MacBook awake with its lid closed
Can your one line terminal invocation automatically put the MacBook to sleep when you are connected via ssh and the connection is lost?
clash··on Caffeine-like utility to keep you MacBook awake with its lid closed
Nope, not thanking you now or later.

1) It is an insane bloat if you just want that one feature. 2) There is no CLI, just GUI.

clash··on Caffeine-like utility to keep you MacBook awake with its lid closed
I found this before I implemented my solution and it did not solve my problem:

1) It does not behave like caffeine where I can just kill the process and the behavior is reverted.

2) It does not put the MacBook to sleep automatically.

clash··on Caffeine-like utility to keep you MacBook awake with its lid closed
1) Because you will eventually forget to reactivate it, which then leads to obvious problems.

2) Because you can for example be connected via ssh: You run the script and if your connection is disconnected, caffeinate+ shuts down the MacBook.

Edit: The API call that 'sudo pmset -a disablesleep 1' does is literally the first thing caffeine+ does. As soon as the lid closes the command is automatically reverted so you can't forget to do it yourself.

clash··on Caffeine-like utility to keep you MacBook awake with its lid closed
Haha, every operating system has its quirks. The auto reboot is certainly a very nasty one.
clash··on Caffeine-like utility to keep you MacBook awake with its lid closed
I wrote a small caffeine-like macOS command-line utility to keep your MacBook awake when you close the lid.

This can be handy when you have a long running task active but need to close your MacBook – for example to change trains, head home from a café or commute to the office.

clash··on New York’s budget bill would require “blocking technology” on all 3D printers
This is an easy one:

bool isRestricted(uint8_t* /* data */) { return true; } // Might catch a few false positives

and

popup("This is a restricted model. If you are not in the state of New York, please flash the international firmware ([link]) to print restricted parts.");

It can also handle STL, step and all kinds of other formats.

clash··on Founding is a snowball
You left out the higher entity that takes away a significant portion of the snow that was accumulated at regular intervals.

It doesn't need to ruin the metaphor, though: The sun could do that job. It could also explain the fact that the portion that's taken differs depending on where on earth you are creating the snowball.

clash··on TÜV Report 2026: Tesla Model Y has the worst reliability of all 2022–2023 cars (2025)
This appears to be even more of a problem with EVs and their regenerative breaking and I wonder whether this could not be easily fixed by software: "Breaks were not used recently or car did not move in some time? ⟹ Temporarily disable regenerative breaking for a few minutes until the break pads can be assumed to be clear again."
clash··on A second generation E-Ink picture frame
Hey guys,

I just wanted to show off the new battery-powered E-Ink picture frame that I have been working on for the last couple of months.

It took a lot of work. I hope you like it.

clash··on Building an e-ink picture frame that displays an iCloud photo album
Actually my devices can download from remote sources as well. An iCloud bridge is be necessary, though.
clash··on Building an e-ink picture frame that displays an iCloud photo album
Very nice. If you don't have the time to build one yourself, you can also buy them here:

https://framelabs.eu/

Note: I sell them.

clash··on Show HN: Building a 42-inch E-Ink frame for generative art
Shameless plug: I build devices like that and sell them. Battery powered.

https://framelabs.eu/en/product/artframe-31/

I use the 31.2" panel because it is 40% cheaper and has higher DPI, but the 42" panel is also possible.

clash··on Ask HN: I'm a self-taught programmer, what am I likely missing
I'll rephrase. Learn about the basic container data structures like linked list, vector, set, map, hash, tree, queue, heap.

Study time complexity of insertion, deletion, search, etc. in these data structures. Then you will understand when to use which. Big O notation is used to express time complexity for expected runtime of the operations.

clash··on Ask HN: I'm a self-taught programmer, what am I likely missing
Knowledge about complexity classes is an issue that at least many hobbyists seem to miss.
clash··on E-Ink Magic Calendar that runs off a battery powered Raspberry Pi
I went online about a year ago. So yes, I already sold a lot of devices.
clash··on E-Ink Magic Calendar that runs off a battery powered Raspberry Pi
This calender-thing really seems to resonate with people!

I built something similar but more versatile, where you can either display images or feed the display with whatever information you want remotely. And it runs on a battery for a whole year:

https://framelabs.eu/en/

clash··on Show HN: A 13.3" battery-powered e-paper picture frame to display digital art
You can't define more than 8. The API allows only 3 bit input. I also tinkered with the lookup table, and was able to create a lot of different gray shades, but I was not able to produce ~40-60% gray.
clash··on Show HN: A 13.3" battery-powered e-paper picture frame to display digital art
The written sizes are correct. By default I will manufacture the two smaller displays with the same frame dimensions. The small device in the comparison image is from a custom order, which allows for a better size comparison. For custom orders I can create the frames in arbitrary sizes accurate to a millimeter. I'll add a note.
clash··on Show HN: A 13.3" battery-powered e-paper picture frame to display digital art
I actually have an Inkplate at home. The 8 gray shades they support are unfortunately not evenly distributed, which makes it difficult to display images in good quality.

EPDiy looks interesting, though.

clash··on Show HN: A 13.3" battery-powered e-paper picture frame to display digital art
If you want to hack it and don't want to pay for consumer grade quality for neither hardware nor software, then the device you linked is a good choice.
clash··on Show HN: A 13.3" battery-powered e-paper picture frame to display digital art
If your grandparents have WiFi at home, you can do exactly that. There is a mode to periodically fetch images from a remote URL.
clash··on Show HN: A 13.3" battery-powered e-paper picture frame to display digital art
Maybe I should think about building a mechanical version ;)
clash··on Show HN: A 13.3" battery-powered e-paper picture frame to display digital art
You can configure the device to connect to you local WiFi and fetch images from wherever. Sample code for an image server is available at https://github.com/framelabs-eu/imageserver
clash··on Show HN: A 13.3" battery-powered e-paper picture frame to display digital art
If you just want to display information, I agree. Black/White & red/yellow is enough. But if you want to display a photo, you need gray shades.
Page 1 of 2Next →