Pete Johanson

Intercepting requests with mitmproxy + Karma test runner

I'm a big fan of mitmproxy. Every time I come back to it after using Fiddler on Windows for work, I am refreshed. Recently, while working on a Karma-run integration test for my work on Siren action support in angular-hy-res, I ran into a funky problem where Firefox was getting a status code of 0 for the XHR request being made as part of the action submission. Since there were several layers of abstraction between ...

angular-hy-res javascript mitmproxy karma hy-res

Pete Johanson

Prototyping RESTful Services With Sinatra

Working on a new project at work recently, we’re developinf a RESTful web service to be accessed by a WPF client. Since we have existing infrastructure to access OpenVista Server using Java (via OVID), the final solution will be a Java one. However, before one of our primarily Java developers would have a chance to put something together, I needed to make progress on the WPF client. Sinatra swaggers in to save the day! ...

sinatra ruby rest

Pete Johanson


At work recently, we had code looking a little something like this: When refactoring the code, I thought about the recent blog post about A Less Ugly Switch Statement and thought I might do something similar with IComparer (and IComparable, but I'll leave that as an excercise for the reader). The envisioned invocation is: I ended up with this implementation: Is this better? I'm not really sure. It is functionally equivalent. Is it more readable, ...

c# .net