MOUNTAIN VIEW, Calif. — Hacker Dojo is equal parts shared office, lecture hall and after-hours salon for a variety of tinkerers, software coders and entrepreneurs who intend to reinvent the future. The idea for Pinterest was cooked up here. The makers of Pebble watches used the space as their West Coast headquarters. Today, however, it is threatened with extinction. City officials in Mountain View have ordered Hacker Dojo to comply with city regulations for offices or move out.

And so the inhabitants of the cavernous warehouse in a city of office complexes have found themselves scrambling to raise money, not for their start-ups, but to save their start-up space. A Kickstarter campaign to raise money expires Friday. (Contribute $256 and get “a box of hacker stuff.”) They have already held a charity run through Mountain View — in their underwear. A continuing charity auction offers, among other things, sex advice and financial tips for start-ups.

The Dojo is an example of the new work spaces that underlie the start-up culture of Silicon Valley. Coffee shops around here can be packed with coders, huddled over glowing Macs for hours at a time. Technology incubators are sprinkled across the valley, but getting into the hottest ones can be as hard as getting into business school; besides, many of them, like Y-Combinator, just down the road from here, extract equity in the start-up in return.

Some shared offices are upscale, providing on-site bookkeepers and full-service cafes. And then there are hacker spaces like this, with distinct identities of their own. Noisebridge in San Francisco calls itself a “space for artistic collaboration and experimentation”; Ace Monster Toys in Oakland offers a laser cutting machine.