My gf at the time and I were looking to move to NYC for school. Apartment hunting isn't super fun - especially in a place neither of us were super familiar with that also happened to be NYC. AND we were going to attend separate campuses.
So naturally I wrote a script that scraped Craigslist for listings (1) in our budget, (2) calculated our individual commute times, (3) filtered the results so that commutes were under an hour or something and (4) posted the listings to a Slack channel with all the info I could scrape. It was working perfectly until she dumped me several days later.
Same - I was doing a bit of contract work on the side when I quit. Did some traveling (briefly) and then ended up making those gigs my job. Haven't even touched my FU/1-year-savings money yet after almost a year...
This seems really valuable for development, but is there a way to use this in production systems? Say a user hits a bug in a CL web app. Could I write an exception handler that (1) immediately returns a 500 error page and (2) persists an image somewhere so that I could fire it up later and have the debugger ready at the offending point?
I think that it's possible. Immediately returning a HTTP 500 is easily doable, and you should be able to fork the Lisp process, continue serving requests in the parent, and save stack information (such as function parameters, etc..) and dump the Lisp core for further analysis in the child. (Do note, however, that this process breaks all FDs, which includes open files and network sockets.)
Depending on how the HTTP library works, one might be able to return an error to the user, but preserve all the other call state in an open thread, and later on join it from an interactive debugger … perhaps even a Lisp debugger running in a Web browser!
That's doable. Common Lisp has a programmable debugger hook which allows for implementing one's own debugger - also, possibly, as a web application. And for situations where the standard debugger hook is not enough (e.g. BREAK or INVOKE-DEBUGGER), one can use https://github.com/phoe/trivial-custom-debugger to completely override the system debugger with a custom one.
So naturally I wrote a script that scraped Craigslist for listings (1) in our budget, (2) calculated our individual commute times, (3) filtered the results so that commutes were under an hour or something and (4) posted the listings to a Slack channel with all the info I could scrape. It was working perfectly until she dumped me several days later.