Autocomplete from Stack Overflow

Tired of writing code? Me too! Let's have Stack Overflow do it.

// Boss wants this function done by tomorrow :( function find(needle, haystack) { var

(Try typing a space. JavaScript only, for now.)

How it works

I grabbed a Stack Overflow data dump from https://archive.org/details/stackexchange and scraped out any code snippets from

accepted answers

with more than 50 points

on posts tagged "javascript"

To complete at run time, it uses the same logic to generate a fingerprint for the context at the current cursor position, and fuzzy-matches that against the database. Matching completions are sorted by a proprietary blend of post score, left-hand context similarity, and nearby identifiers.

Thanks to