Show HN: Code search for StackOverflow (redrowstudio.com)
I often find myself going to stackoverflow or similar sites to find example snippets of code for something that I can't quite remember how to do. E.g. I'm working on a Grails app and I want to specify a maximum length for a domain object field. I know that I need to add a constraints block, but I can't remember the exact syntax - is it
fieldname(maxlength:10)
or
fieldname { length, 10 }
or something different. All I really need to see is an example to remind me how to do it. So I build this page, which searches stackoverflow posts for a posts with a given tag which contain a query string inside a code block, and displays them as snippets. You can click through to the full SO post for each result by clicking on the title.
This page is the hackiest of hacks; it uses the stackexchange data explorer to grab results, so it's very slow for tags that have a lot of posts. If other people find it useful then I'll redo it properly with a local database with full-text indexing.
0 comments
[ 3.8 ms ] story [ 13.9 ms ] threadNo comments yet.