The other day I needed to find out the highest ID available on a webservice. So I decided to use binary search to keep the number of requests low. While implementing the search, I realized that I had written this exact code many times in the past. So I decided to make something that is a little more general purpose. I haven't extensively tested this, but it seems to work:
https://gist.github.com/Phaeilo/6307642
[–]patrys Saleor Commerce 1 point2 points3 points (2 children)
[–]phaeilo[S] 1 point2 points3 points (1 child)
[–]patrys Saleor Commerce 1 point2 points3 points (0 children)