TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Code search for StackOverflow

3 pointsby moj34about 13 years ago
This is an afternoon project that I whipped up yesterday to search inside code blocks in StackOverflow posts.<p>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 <i>constraints</i> block, but I can't remember the exact syntax - is it<p>fieldname(maxlength:10)<p>or<p>fieldname { length, 10 }<p>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.<p>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.

no comments

no comments