Early last week, I started a Twitter thread storm with the hashtag #7DaysOfSearch.
For seven days, I showed the beaming developer community how to search for code via the premier code search engine, 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 in one place. A one-page reference for the #7DaysofSearch tweetstorm.
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, you can search for code from open source repositories.
Here's a full rundown:
With OSS projects indexed by @sourcegraph, you'll be able to use code libraries and dependencies more effectively.
It's also a faster way to summon code examples while building 😁.
Here’s how to add open-source software projects to Sourcegraph Cloud. #thread #7daysofsearch08:42 AM - 24 Aug 2021
Have you ever been faced with an error message while building software and spent a really long time trying to figure out where it was coming from? 🤔
What if you could paste the error message in a code search engine that'll show you where to look? #7DaysOfSearch17:46 PM - 25 Aug 2021
Searching code across your personal & organization private repositories is a very common activity. We all do it, but do we enjoy it?
The larger the codebase, the harder it is to search for code seamlessly.
I'll show how you can do that easily with @sourcegraph #7DaysOfSearch18:27 PM - 26 Aug 2021
Sourcegraph supports three kinds of search patterns: literal, regular expression, & structural.
By default, all search queries on @sourcegraph are treated as literal patterns.
If you know the exact string that you’re looking for in a codebase such as... #7DaysOfSearch14:40 PM - 27 Aug 2021
To round up #7DaysOfSearch, I'll cover some of the search tricks you can use to search code on @sourcegraph. Let's go! 🔥🚀
1. Search code within an organization’s repository.
Let's search for how Carbon::now & Auth::guard is used in all of @laravelphp's repositories.13:28 PM - 31 Aug 2021
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?
There's a lot to learn about code search. I just scratched the surface of what's possible with code search using Sourcegraph.
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?