7 Majestic Days of Code Search
Tags: codesearch, search, code
Published: 2021-09-02 16:07:50

Early last week, I started a Twitter thread storm with the hashtag [#7DaysOfSearch](https://twitter.com/hashtag/7DaysOfSearch). 

For seven days, I showed the beaming developer community how to search for code via the premier code search engine, [sourcegraph.com](https://sourcegraph.com).

It was a fantastic experience. I became aware of developers' hunger for better code search tools, so I decided to put all my tweets about [#7DaysOfSearch](https://twitter.com/hashtag/7DaysOfSearch) in one place. A one-page reference for the [#7DaysofSearch](https://twitter.com/hashtag/7DaysOfSearch) tweetstorm. 

## What is Sourcegraph?

Sourcegraph is a software tool that enables developers and anyone to search, explore and better understand code faster, with contextual code intelligence to improve developer productivity and automate large-scale code change management.

On [sourcegraph.com](https://sourcegraph.com), you can search for code from open source repositories. 

With an account on [sourcegraph.com](https://sourcegraph.com), [you can add private](https://learn.sourcegraph.com/how-to-add-private-code-repositories-to-sourcegraph) and [public open-source repositories](https://learn.sourcegraph.com/how-to-add-open-source-software-projects-to-sourcegraph-cloud) and [search for code within those repositories](https://learn.sourcegraph.com/how-to-search-code-with-sourcegraph-a-cheat-sheet).

## #7DaysOfSearch Recap

Here's a full rundown:

#### **Day 1: How to add open source repositories to Sourcegraph**

{% twitter 1430088108435984394 %}

#### **Day 2: How to find error messages with Sourcegraph**

{% twitter 1430587410144972805 %}

#### **Day 3: How to add private code repositories to Sourcegraph**

{% twitter 1430960205467111433 %}

#### **Day 4: How to search code with Sourcegraph using literal patterns**

{% twitter 1431265267510820866 %}

#### **Day 5: How to search code with Sourcegraph using regular expression**

{% twitter 1431695027332341760 %}

#### **Day 6: How to search code with Sourcegraph using structural search patterns**

{% twitter 1432236512465362945 %}

#### **Day 7: Code search tips and tricks with Sourcegraph** 

{% twitter 1432696887270858755 %}

## Quick Code Search Challenge

Sourcegraph has already indexed more than 1 million reports and is committed to indexing by the end of this year every project on GitHub or GitLab with one or more stars (~5.5 million repositories). So, armed with this information, I'll present a quick challenge!

**Challenge:** You need to get the top 5 GitHub OSS code repositories that use the **navigator.sendBeacon** Web API. How would you go about it?

Feel free to post your answer in the comment section or tweet at me ([@unicodeveloper](https://twitter.com/unicodeveloper) with the hashtag [#7DaysOfSearch](https://twitter.com/hashtag/7DaysOfSearch) [#SourcegraphCodeSearchChallenge](https://twitter.com/hashtag/sourcegraphcodesearchchallenge)

## Wrapping Up

There's a lot to learn about code search. I just scratched the surface of what's possible with [code search using Sourcegraph](https:learn.sourcegraph.com). 

As a developer, designer and educational researcher, Sourcegraph provides enough flexibility and power to find code and resources to build your projects quickly!

Now, I have a few questions for you:

- What tools do you currently use for code search?
- What would you like to learn about code search?
- If you already use Sourcegraph, what would you like to see or know?

Furthermore, if you found any of the tips from the seven days useful, feel free to like & RT on Twitter. Would you mind dropping your best tip in the comment section?