This question has been asked (and answered) on this forum before, but my question is when is the cutoff after which it is considered eating before shachris (as opposed to eating AFTER maariv). Specifically, if my work requires me to be up all night (which it has), I would wake up around 10 pm, do maariv, eat "breakfast", report to work, and around 3 am or 4 am, have "lunch". Is this permissible?
The Shulchan Aruch (OC 89:5) discusses what to do if you were eating before dawn (alot hashachar; the earliest time for Shacharit), and then dawn happened (and now you are obligated in Shacharit): must you stop eating or not. It seems from here that you are allowed to eat so long as dawn has not happened. The Mishna Berura there notes that if the eating is of a settled nature, one shouldn't start it even half an hour before dawn, lest it continue.
He also quotes the Zohar who recommends not eating before davening if one went to sleep and awoke for Shacharit any time after midnight, but he (the MB) agrees this is not the basic letter of the law.
You can find times for dawn based on your location online (eg. http://www.myzmanim.com).
As an additional resource, i am posting what I received in the Dirshu halacha yomi email this morning:
A person may not begin a meal within a half-hour of alos hashachar out of concern that the meal may stretch into the morning and cause him to forget to recite Kriyas Shema. Snacks, though, may be consumed until alos hashachar. According to the Zohar, a person should abstain from any type of eating upon arising from a night’s sleep. It is proper to follow this stringency unless eating is necessary to ward off weakness or to prevent bitul Torah. A person may eat on the night before a ta’anis prior to alos hashachar, as long as he follows the above-mentioned halacha of not starting a meal within a half-hour of alos. A person who intends to eat before the requirement to fast begins must stipulate before going to sleep that he is not accepting the ta’anis yet and still plans to eat upon arising.
[שו"ע תקסד, א, ומשנ"ב ד-ה; וראה שעה"צ ג; ביאורים ומוספים דרשו, 1 ו־6 ,בהרחבה ע"פ המקור]