Good for you making an app to scratch your own itch!
Pardon being negative when I know you are sharing some of your self with the world by showing HN.
I don't even mind the runtime tomfoolery, but it's disingenuous to say "Apple doesn't trust you to make grown-up decisions yet about what applications you want to run".
First off, "yet"? They're going to change they're mind at some point about code signing?
And second, nw.js apps like Kitematic can sign their code, no matter how quick a hack this is don't belittle Apple's security to explain away your laziness of not signing your app.
Thank you for sharing, although the glamorizing of killing yourself for work is also a bit disturbing.
Ya this is not a problem I've ever had. If I'm that tired I just go to bed. I've had many a late night but never such that I'm unable to control where it is I fall asleep. Not sure how common thesw habits are.
I think it's more common among students (which the author happens to be). I used to fall asleep on my laptop during all-nighters in the library fairly often in college, when I didn't have the luxury of just going to sleep because I was tired.
On the other end of the spectrum, we've got things like redshift, and redshift-schedule, which alter the temperature on your screen to avoid sleep-depravation and actually maintain healthier sleeping habits.
I used both, especially for a time when I started migrating to polyphasic sleep.
I find the technology choice here very interesting, a desktop applet programmed with what I look at as mainly web technologies (JavaScript, JSON, Node, Webkit). It's impossible to ignore how the landscape has changed in the past 5 years and how web-style programming is slowly bleeding into spaces dominated by native applications.
When I first got into software development years ago with an eye for tools and games, I approached web programming as a stepping stone. I wonder what direction I would go if I were to start over today.
I prefer to put as few layers of abstraction between me and the hardware as feasible. Maybe because the first part of my career was in embedded software.
Yes. node-webkit / nw.js is really slick. I love that I can create a desktop app without even a hint of Cocoa or Obj-C on my part. The runtime is like 90mb, yes, but the source itself is 4mb including dependencies. Memory usage is decent at ~18mb
I don't know about you, but I don't want an applet as small as this eating up 18MB...
Really, what's up with you people?
BTW, not saying that the idea is bad or anything, but it's sad to see people talking about such a waste of resources like it's OK to use in "production". People have other stuff running on their machines and it adds up, quickly.
> The runtime is like 90mb, yes, but the source itself is 4mb
Not to be too acerbic, but, first of all, 4 MB is already huge for an applet. Secondly, how does the fact that the source is 4 MB excuse the 90 MB runtime?!
There are plenty of other languages that are probably already installed on a given person's laptop (e.g.python, ruby, clang, swift now? etc. come built in) that also are better suited for an user-facing app with no web dependencies.
Not to mention webkit running a menu bar app is nauseous, though I would certainly hope 99% of the framework isn't involved.
"If you get an error saying that this app is from an unknown developer, that's because Apple doesn't trust you to make grown-up decisions yet about what applications you want to run. Just find Sleep app in your Applications folder, right click on it, and click Open."
Yes, Apple doesn't trust you, and with good reason. I think we have properly demonstrated the average public has no sense at all when when it comes to running software from unknown developers with the chance that it is potentially malicious and damaging.
The setting to turn that off permanently is really only a couple of clicks away. "Grown-ups" know how to find it easily. Others are better off not being able to do it without understanding how it works.
I don't think developers do either. Apple prompting you when you run an untrusted app for the first time is almost certainly a good thing (app replaced with a malicious one? you'll get an unexpected prompt), and it hurts nobody.
Sounds to me like the real solution to this problem is to have some sleep hygiene and get off of your laptop for awhile when you get sleepy.
If I was frequently waking on the couch with my laptop on my chest I wouldn't think "gee, did I get enough sleep? I should write an application that detects what time I doze off on the couch!" I'd think "Wow, I need to address my late night computing habits, as they're clearly interfering with my sleep."
So you want to answer the questions 'when did i fall sleep last night?' and 'did i get enough sleep?' I have to wonder why.
It suggests you are wanting to ensure you get a healthy amount of sleep by getting the answers to these questions. But really, you don't need to answer these questions at all. Instead just time-box the amount of sleep you should have (whatever you determine that to be) and then just set alarms on your phone/laptop around your schedule to instruct you when to go to bed and when to sleep - sorted.
I sense your overly elaborate, approximate solution to your problem is a result of you suffering from sleep deprivation! ;)
(source: http://apple.stackexchange.com/questions/52064/how-to-find-o...)