<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sourcegraph</title>
    <description>The latest articles on DEV Community by Sourcegraph (@sourcegraph).</description>
    <link>https://dev.to/sourcegraph</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F4522%2F36950af1-cf2c-4979-bd0f-79873ddbc44d.png</url>
      <title>DEV Community: Sourcegraph</title>
      <link>https://dev.to/sourcegraph</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sourcegraph"/>
    <language>en</language>
    <item>
      <title>Cody June 2023 (version 5.1): Better codegen, more recipes, more context, more editors</title>
      <dc:creator>Bachi Degli Innocenti</dc:creator>
      <pubDate>Wed, 28 Jun 2023 19:15:33 +0000</pubDate>
      <link>https://dev.to/sourcegraph/cody-june-2023-version-51-better-codegen-more-recipes-more-context-more-editors-4185</link>
      <guid>https://dev.to/sourcegraph/cody-june-2023-version-51-better-codegen-more-recipes-more-context-more-editors-4185</guid>
      <description>&lt;p&gt;The June 2023 release of Cody (version 5.1) brings even more powerful and accurate code AI to devs. Not only can Cody suggest AI-generated autocompletions in your editor like GitHub Copilot, it can also write entire files, fix bugs, refactor code, and answer questions about your entire codebase. Cody’s power and accuracy comes from supplying the LLM with better context about your codebase--also known as “cheating” from Steve Yegge’s &lt;a href="https://about.sourcegraph.com/blog/cheating-is-all-you-need"&gt;Cheating Is All You Need&lt;/a&gt; post--which builds on our work at &lt;a href="https://about.sourcegraph.com/"&gt;Sourcegraph&lt;/a&gt; creating the leading code search engine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Highlights:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🪄 &lt;strong&gt;Better autocomplete,&lt;/strong&gt; with a more powerful LLM (Anthropic Claude) and broader context. Free for devs.&lt;br&gt;
🧪 &lt;strong&gt;New and improved recipes:&lt;/strong&gt; explain code, fix code smells, optimize performance, and more.&lt;br&gt;
💬 &lt;strong&gt;Inline chat&lt;/strong&gt;, for easy fixes, refactors, and questions on specific regions of code files.&lt;br&gt;
🌐 &lt;strong&gt;Multi-repository context&lt;/strong&gt;, so Cody looks beyond just the current repository for knowledge when writing/fixing code and answering questions.&lt;br&gt;
➕ &lt;strong&gt;Support for JetBrains IDEs&lt;/strong&gt;: IntelliJ, PyCharm, WebStorm, etc. Editor support for Emacs and Neovim is coming soon.&lt;br&gt;
💻 &lt;strong&gt;The Cody desktop app&lt;/strong&gt;, which makes it easy for individuals to use Cody on your private code in your editor and in a chat UI. No server deployment needed.&lt;br&gt;
Cody is free forever for devs on both public and private code. You only need to pay if you exceed the (generous) rate limits or for team/company/enterprise features.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://about.sourcegraph.com/cody"&gt;Get started with Cody&lt;/a&gt;, or download the editor extension directly for &lt;a href="https://dev.toVS%20Code"&gt;VS Code&lt;/a&gt; or &lt;a href="https://plugins.jetbrains.com/plugin/9682-sourcegraph"&gt;JetBrains&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Better autocomplete
&lt;/h2&gt;

&lt;p&gt;Like GitHub Copilot, Cody suggests AI-generated autocompletions in your editor. In this release, we’ve shipped some big improvements to Cody’s autocomplete (and moved it from experimental to beta):&lt;/p&gt;

&lt;p&gt;Broader context for more idiomatic code suggestions: Cody is the first code AI to autocomplete based on context from the entire repository, using embeddings-based semantic search. This means Cody can generate better code that uses more of your codebase’s own APIs and idiomatic usage patterns, compared to GitHub Copilot and others that only use recent files and open tabs.&lt;br&gt;
More powerful LLM (Anthropic Claude): An LLM with greater general reasoning capability plus a larger context window means Cody’s suggestions can be better and more accurate than other code AI tools (including GitHub Copilot) that use simpler LLMs.&lt;br&gt;
Free for devs, with a very &lt;a href="https://about.sourcegraph.com/blog/increasing-the-completions-rate-limit"&gt;generous rate limit&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Today, most devs will find Cody’s autocomplete and GitHub Copilot’s autocomplete roughly equivalent (but remember that Cody is free!).&lt;/p&gt;

&lt;p&gt;We expect Cody autocomplete to keep improving quickly. Our approach—more and better context, more powerful LLM—is different from that of other AI code autocomplete tools that optimize for limited context and small models. We’re optimistic that this maximal approach will definitively surpass the minimal approach.&lt;/p&gt;

&lt;p&gt;If you want to try Cody autocomplete and compare it with GitHub Copilot, you can toggle Cody autocomplete on/off and still keep using Cody for everything else (chat, recipes, codegen, etc.). Send us your feedback!&lt;/p&gt;

&lt;h2&gt;
  
  
  New and improved recipes
&lt;/h2&gt;

&lt;p&gt;Cody can explain, write, fix, and refactor code using your codebase’s own APIs, docs, and usage patterns. This goes way beyond autocomplete or prompt engineering. It’s possible only because Cody supplies context about your own code to a powerful LLM, so it can perform higher-level coding tasks.&lt;/p&gt;

&lt;p&gt;In this release, we’ve added and updated many of our favorite recipes:&lt;/p&gt;

&lt;p&gt;Explain code using broad knowledge of your codebase and internal APIs&lt;br&gt;
Generate unit test using your preferred test frameworks and conventions&lt;br&gt;
Generate docstring using your codebase’s style&lt;br&gt;
Improve variable names because naming is one of the hard things about computer science&lt;br&gt;
Smell code to find and fix code smells&lt;br&gt;
Generate release notes based on recent commits&lt;br&gt;
Generate pull request description&lt;br&gt;
Optimize code performance&lt;br&gt;
Special shoutout to community members Deepak Kumar and Momil Ijaz for contributing recipes to Cody!&lt;/p&gt;

&lt;h2&gt;
  
  
  Inline chat
&lt;/h2&gt;

&lt;p&gt;While recipes help quickly accomplish specific tasks, Cody chat gives users more freeform capabilities. As a user, you may want to ask Cody questions like:&lt;/p&gt;

&lt;p&gt;Why is this code not working like I expect it to?&lt;br&gt;
Why is this function so slow?&lt;br&gt;
Can you make this thing work?&lt;br&gt;
Inline chat for Cody, now in beta, makes it easy to ask questions and get direct inline fixes at any point in your code. You can start a chat with Cody directly at a certain point in your code file, and Cody will use the context at that line to answer your question.&lt;/p&gt;

&lt;p&gt;Cody can also write and edit code itself, and you can use inline chat to requests fixes and refactors. Cody will make direct edits to your code, and you can choose to accept or undo any changes.&lt;/p&gt;

&lt;p&gt;To open a Cody inline chat, click the + icon to the left of any line in your file. With the chat window open, you can either ask Cody questions or use a slash command, such as:&lt;/p&gt;

&lt;p&gt;/fixup. Cody will make changes directly to your code inline.&lt;br&gt;
/touch. Cody puts its output in a new file.&lt;br&gt;
Multi-repository context&lt;br&gt;
Cody’s ability to answer questions about your code comes from its ability to pull context from the code graph. The code graph is the schema of code and code metadata built by the Sourcegraph platform when connected to all of your code hosts.&lt;/p&gt;

&lt;p&gt;Before today, Cody would respond to queries by pulling context from your currently-open repository. When used with Sourcegraph 5.1, Cody can now pull context from multiple repositories in the code graph at the same time. In practice, this means that Cody can tell you about code and services that span multiple repositories.&lt;/p&gt;

&lt;p&gt;Multi-repository context fetching is available when using Cody via the web interface. To enable this in Cody on the web, click “Add repositories” under the chat bar, and select the repositories you’d like Cody to fetch context from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Support for JetBrains IDEs
&lt;/h2&gt;

&lt;p&gt;We want Cody to be available wherever you write code, and the #1 request we’ve received is to bring Cody to IntelliJ and other JetBrains IDEs. Cody is now available as a plugin for JetBrains IDEs (AppCode, Android Studio, CLion, GoLand, IntelliJ IDEA, PhpStorm, PyCharm, Rider, RubyMine, WebStorm, and all new IDEs that JetBrains releases), and you can &lt;a href="https://plugins.jetbrains.com/plugin/9682-sourcegraph"&gt;download it today&lt;/a&gt;. The plugin supports the Cody chat sidebar, recipes, and code autocomplete.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kGECWgQ5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/flpz2ifvnb4fm6vitrtb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kGECWgQ5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/flpz2ifvnb4fm6vitrtb.png" alt="Image description" width="800" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can connect the JetBrains plugin to a Sourcegraph.com account to use on public code and to a Sourcegraph Enterprise account or the Cody desktop app to use for a private codebase.&lt;/p&gt;

&lt;p&gt;Cody is also available for VS Code, with support coming soon for Neovim and Emacs. Join the waitlist to be notified when more editors are available or to request a new editor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cody desktop app
&lt;/h2&gt;

&lt;p&gt;If a code AI tool can only fetch context from recent files, open tabs, or a ripgrep search, it’s going to be limited and inaccurate. It’ll often fail to find relevant code snippets across your entire codebase, so its autocompletions and answers will be less idiomatic and more likely to be flat-out hallucinated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n8PkufYu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/drzmeils9i29hvex1r0n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n8PkufYu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/drzmeils9i29hvex1r0n.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The solution to this is a persistent server or application that has indexed the codebase and serves context to your editor’s code AI tool. Today we’re releasing the Cody desktop app, a service that runs in the background of your local machine, serving as the integration point between your codebase and IDE extensions to make Cody more accurate.&lt;/p&gt;

&lt;p&gt;Ask Cody a question in your editor and Cody will fetch context from the app’s code graph instead of using local keyword search, leading to more accurate answers generated with a broader understanding of your code.&lt;/p&gt;

&lt;p&gt;Context from the app improves all of Cody's features:&lt;/p&gt;

&lt;p&gt;Code autocomplete: Cody makes autocompletions based on existing components in a repository, such as React components or functions, regardless of if those components are in open files or elsewhere in a repository.&lt;br&gt;
Chat: Ask Cody about functions or components that are being imported from another file, and Cody will find the component’s definition to explain it. Other code AI tools often can’t find where components are defined if the relevant file isn’t already open.&lt;br&gt;
Recipes: Cody can summarize recent changes to a repository based on context of the commit history. If you ask other code AI tools to do this, they’ll simply say they don’t have access to that data.&lt;br&gt;
The app is the best way to use Cody for free, and it’s &lt;a href="https://about.sourcegraph.com/cody"&gt;available to download today&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>programming</category>
      <category>sourcegraph</category>
    </item>
    <item>
      <title>Announcing scip-clang: a new SCIP indexer for C and C++</title>
      <dc:creator>Bachi Degli Innocenti</dc:creator>
      <pubDate>Wed, 17 May 2023 17:56:23 +0000</pubDate>
      <link>https://dev.to/sourcegraph/announcing-scip-clang-a-new-scip-indexer-for-c-and-c-366h</link>
      <guid>https://dev.to/sourcegraph/announcing-scip-clang-a-new-scip-indexer-for-c-and-c-366h</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/sourcegraph/scip-clang"&gt;scip-clang&lt;/a&gt; is our new indexer for C and C++ code written from the ground up to natively emit &lt;a href="https://github.com/sourcegraph/scip"&gt;SCIP&lt;/a&gt; and especially support the wide range of language features present in C++.&lt;/p&gt;

&lt;p&gt;For teams using C and C++, indexing your code with scip-clang can provide a significantly improved code navigation experience in Sourcegraph, similar to editors like VS Code (based on clangd) and CLion. scip-clang's precise code navigation is aware of build configurations, macros, and type information. Some examples of when this is particularly useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Navigating class hierarchies, such as those using virtual functions with overriding, or the Curiously Recurring Template Pattern. In such cases, identically named methods appear in multiple class definitions, leading to false positives with search-based code navigation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Different C++ container types often use identical method names like find and contains, which may have multiple overloads. Precise code navigation enables accurately navigating to the correct method overload in the correct type without false positives.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Understanding whether a definition comes from inside a macro expansion. In such cases, since the definition is not explicitly available in the source, it is not accessible to search-based code navigation. However, precise code navigation can accurately point to the macro expansion.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can explore precise code navigation powered by scip-clang in the following repositories: &lt;a href="https://sourcegraph.com/github.com/chromium/chromium@b21c706/-/blob/base/atomic_ref_count.h?L19:7-19:21#tab=references"&gt;Chromium&lt;/a&gt; (C++), &lt;a href="https://sourcegraph.com/github.com/llvm/llvm-project@39a0677/-/blob/llvm/include/llvm/Support/raw_ostream.h?L52:7-52:18#tab=references"&gt;LLVM&lt;/a&gt; (C++), &lt;a href="https://sourcegraph.com/github.com/postgres/postgres@63932a6d38e5dfa6df2a51a04b7314ec1e4d3de7/-/blob/src/backend/optimizer/plan/setrefs.c?L289:21-289:32#tab=references"&gt;Postgres&lt;/a&gt; (C).&lt;/p&gt;

&lt;p&gt;Continue reading here: &lt;a href="https://about.sourcegraph.com/blog/announcing-scip-clang"&gt;https://about.sourcegraph.com/blog/announcing-scip-clang&lt;/a&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Installing and customizing Visual Studio Code: VS Code setup from scratch</title>
      <dc:creator>Erika Heidi</dc:creator>
      <pubDate>Fri, 18 Feb 2022 15:14:43 +0000</pubDate>
      <link>https://dev.to/sourcegraph/installing-and-customizing-visual-studio-code-vs-code-setup-from-scratch-3c62</link>
      <guid>https://dev.to/sourcegraph/installing-and-customizing-visual-studio-code-vs-code-setup-from-scratch-3c62</guid>
      <description>&lt;p&gt;&lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt; (VS Code) is a source code editor or IDE (&lt;em&gt;Integrated Development Environment&lt;/em&gt;) freely available for all major operating systems. Although VSCode has native features to help you develop applications and websites in several languages, what makes VS Code an excellent choice for developers is the vast ecosystem of extensions that allow you to customize and fine tune your VS Code installation to meet your specific needs.&lt;/p&gt;

&lt;p&gt;In this article, you'll learn how to install and customize VS Code to make it the right fit for your coding needs. You'll also get a list of recommended extensions for improving your overall productivity, no matter your programming language of choice. As an appendix, I've included a few extensions that I personally use for PHP Development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Visual Studio Code
&lt;/h2&gt;

&lt;p&gt;As mentioned earlier, VS Code is available for all major operating systems. To get started, access their &lt;a href="https://code.visualstudio.com/download" rel="noopener noreferrer"&gt;download page&lt;/a&gt; and download the adequate installer for your system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing on Ubuntu
&lt;/h3&gt;

&lt;p&gt;For Ubuntu systems, the operating system in which this article is validated, you should download the &lt;code&gt;.deb&lt;/code&gt; file. Once it's downloaded, you can install it from your terminal with &lt;code&gt;sudo dpkg -i file.deb&lt;/code&gt;, like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;sudo &lt;/span&gt;dpkg &lt;span class="nt"&gt;-i&lt;/span&gt; code_1.63.2-1639562499_amd64.deb


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Installing on other systems
&lt;/h3&gt;

&lt;p&gt;For other systems, download and execute the appropriate installer.&lt;/p&gt;
&lt;h2&gt;
  
  
  Getting familiar with the interface
&lt;/h2&gt;

&lt;p&gt;After installation is complete, open VS Code. You'll see a "Get Started" page like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flnksh56hm51lo39l5wds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flnksh56hm51lo39l5wds.png" alt="VS Code getting started page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this page you have some shortcuts to change your configuration, set up synchronization, and install language-specific extensions. You don't need to do this now; first, let's explore how to navigate the IDE interface.&lt;/p&gt;
&lt;h3&gt;
  
  
  Opening a project in VS Code
&lt;/h3&gt;

&lt;p&gt;To open an existing project, use the &lt;strong&gt;files icon&lt;/strong&gt; on the left menu (it's the first icon). Then, choose a project directory to open, or clone a remote repository to get started.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F97rfa6uoe52lgaeaydrk.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F97rfa6uoe52lgaeaydrk.gif" alt="Opening a project at VS Code"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Changing the font size
&lt;/h3&gt;

&lt;p&gt;Open a file from your project and check if you are satisfied with the default font size. With bigger resolutions and screens, there's a chance you may need to increase the font size for more comfortable reading. You can do this by accessing the menu &lt;strong&gt;File&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Preferences&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Settings&lt;/strong&gt; and then searching for "font" on the search bar that appears at the top. Look for the option &lt;strong&gt;Editor font size&lt;/strong&gt; and change it to your desired size.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqck2cykozq1pqafxnz5y.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqck2cykozq1pqafxnz5y.gif" alt="Changing the font size"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Increase the IDE fonts / window zoom level
&lt;/h3&gt;

&lt;p&gt;Changing the editor font won't modify the IDE interface font size. To increase the UI fonts, go to the Settings page via the menu &lt;strong&gt;File&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Preferences&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Settings&lt;/strong&gt; and search for "zoom" on the search bar that appears at the top. Change the &lt;strong&gt;Window zoom level&lt;/strong&gt; to a value such as 1 or 2 and see if that looks better.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwb9yuygz8hz69bwtyet.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqwb9yuygz8hz69bwtyet.gif" alt="Increasing zoom level on vscode"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Changing the editor theme
&lt;/h3&gt;

&lt;p&gt;To change the default editor color theme, go to &lt;strong&gt;File&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Preferences&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Color Theme&lt;/strong&gt; or hit &lt;code&gt;CTRL+K CTRL+T&lt;/code&gt; to access the theme selection menu. There are a few different options, in both dark and light schemes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fireccri3osyc7ohe9sii.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fireccri3osyc7ohe9sii.gif" alt="Changing VS Code theme"&gt;&lt;/a&gt;&lt;br&gt;
_ The theme chosen in this gif is "Monokai Dark"._&lt;/p&gt;
&lt;h2&gt;
  
  
  Using the source control tool
&lt;/h2&gt;

&lt;p&gt;The third icon on the left menu will give you access to VS Code's built-in source control tool, a helper tool that allows you to discard and commit changes to source control without the need to run commands from a terminal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnevmvq3p7c1q2rzdvnds.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnevmvq3p7c1q2rzdvnds.gif" alt="Using VS Code source control tool"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  How to install extensions
&lt;/h2&gt;

&lt;p&gt;Once you're satisfied with your basic setup, you may want to start exploring VS Code extensions. The &lt;a href="https://marketplace.visualstudio.com/VSCode" rel="noopener noreferrer"&gt;VS Code Marketplace&lt;/a&gt; offers a large collection of useful extensions to customize your VS Code so that it attends all your coding needs.&lt;/p&gt;

&lt;p&gt;There are two different ways to install an extension from the marketplace:&lt;/p&gt;
&lt;h3&gt;
  
  
  Installing directly through the IDE
&lt;/h3&gt;

&lt;p&gt;You can search and install extensions directly from the VS Code interface by accessing the extensions tab, the 5th button on the top left menu. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F64cj7bf8e3q4mw4m0l2q.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F64cj7bf8e3q4mw4m0l2q.gif" alt="Installing a VS Code extension through the IDE"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Installing with a command
&lt;/h3&gt;

&lt;p&gt;If you are navigating the marketplace looking for extensions and find one you want to install, you can do so with a command executed through VS Code's "quick open" shortcut  (&lt;code&gt;CTRL+P&lt;/code&gt;). The extension page typically has instructions on how to do so. For instance, let's say you want to install the &lt;a href="https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one" rel="noopener noreferrer"&gt;Markdown all in one extension&lt;/a&gt;, a popular markdown extension for VS Code. From VS Code, type &lt;code&gt;CTRL+P&lt;/code&gt; and paste in the following command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

ext install yzhang.markdown-all-in-one


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy1hqx1zzky8vvt165eth.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy1hqx1zzky8vvt165eth.gif" alt="Installing a VS Code extension using the quick open menu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each extension has a unique name that you can find on the extension's marketplace page. You'll need that name to install the extension with the &lt;code&gt;ext install&lt;/code&gt; command.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recommended productivity extensions
&lt;/h2&gt;

&lt;p&gt;In this section, you'll find a collection of recommended extensions that can be useful to improve your coding productivity regardless of your programming language of choice.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sourcegraph code search
&lt;/h3&gt;

&lt;p&gt;The newly released &lt;a href="https://marketplace.visualstudio.com/items?itemName=sourcegraph.sourcegraph" rel="noopener noreferrer"&gt;Sourcegraph VS Code extension&lt;/a&gt; allows you to search code across millions of open source repositories right from your IDE. You don't need an account to use the plugin, but connecting to a free account enables you more features such as searching across your private repositories on multiple code host services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhamo5ewc7ell24bvrq2a.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhamo5ewc7ell24bvrq2a.gif" alt="Sourcegraph code search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

ext &lt;span class="nb"&gt;install &lt;/span&gt;sourcegraph.sourcegraph


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In the following video, I show a brief overview of how to use the Sourcegraph plugin on VS Code to search for examples of how a method is used across open source repositories.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/qoo9MdvvuxQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;For more information and tips on how to use Sourcegraph's VS Code extension, check &lt;a href="https://about.sourcegraph.com/blog/ways-to-use-sourcegraph-extension-for-vs-code/" rel="noopener noreferrer"&gt;this blog post&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prettier
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode" rel="noopener noreferrer"&gt;Prettier&lt;/a&gt; is a popular code formatting tool that is also available as a VS Code extension. It enforces a consistent code style based on a set of rules that take into consideration the maximum line length, wrapping and reformatting code when necessary.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;p&gt;ext &lt;span class="nb"&gt;install &lt;/span&gt;esbenp.prettier-vscode&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Docker&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="//ext%20install%20ms-azuretools.vscode-docker"&gt;Docker extension&lt;/a&gt; allows you to quickly manage your Docker environment through VS Code. It also provides one-click debugging of Node.js, Python, and .NET Core inside a container.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;p&gt;ext &lt;span class="nb"&gt;install &lt;/span&gt;ms-azuretools.vscode-docker&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Color Highlight&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;Especially useful for developers who work with front end, the &lt;a href="https://marketplace.visualstudio.com/items?itemName=naumovs.color-highlight" rel="noopener noreferrer"&gt;Color Highlight extension&lt;/a&gt; adds a colored border around colors, which is very handy to give you an instant reference for web colors without having to reload a page on your browser.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;p&gt;ext &lt;span class="nb"&gt;install &lt;/span&gt;naumovs.color-highlight&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Project Manager&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager" rel="noopener noreferrer"&gt;Project Manager extension&lt;/a&gt; enables advanced project management on VS Code. It allows you to organize your projects into virtual workspaces with support to tags and remote development.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;p&gt;ext &lt;span class="nb"&gt;install &lt;/span&gt;alefragnani.project-manager&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Markdown all in one&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;With over 3 million downloads, the &lt;a href="https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one" rel="noopener noreferrer"&gt;Markdown all in one&lt;/a&gt; extension is a must-have for anyone who writes documentation in the markdown language.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;p&gt;ext &lt;span class="nb"&gt;install &lt;/span&gt;yzhang.markdown-all-in-one&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Spell Right&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;With the &lt;a href="https://marketplace.visualstudio.com/items?itemName=ban.spellright" rel="noopener noreferrer"&gt;Spell Right extension&lt;/a&gt; you'll have a lightweight and offline spellcheck right into your VS Code installation. It supports several languages and file types.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;p&gt;ext &lt;span class="nb"&gt;install &lt;/span&gt;ban.spellright&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  CodeSnap&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://marketplace.visualstudio.com/items?itemName=adpyke.codesnap" rel="noopener noreferrer"&gt;CodeSnap extension&lt;/a&gt; allows you to take beautiful screenshots of your code.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;p&gt;ext &lt;span class="nb"&gt;install &lt;/span&gt;adpyke.codesnap&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Emmet Live&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://marketplace.visualstudio.com/items?itemName=ysemeniuk.emmet-live&amp;amp;ssr=false#overview" rel="noopener noreferrer"&gt;Emmet Live&lt;/a&gt; extensions enables support to &lt;a href="https://docs.emmet.io/abbreviations/" rel="noopener noreferrer"&gt;emmet abbreviations&lt;/a&gt;, special expressions that are evaluated and turned into structured code snippets, such as HTML code. &lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;p&gt;ext install ysemeniuk.emmet-live&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  TailwindCSS Intelesense&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss" rel="noopener noreferrer"&gt;TailwindCSS Intelesense extension&lt;/a&gt; adds syntax highlight and autocomplete for TailwindCSS projects on VS Code.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;p&gt;ext &lt;span class="nb"&gt;install &lt;/span&gt;bradlc.vscode-tailwindcss&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Appendix: PHP extensions&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;In this section, you'll find a collection of extensions that are useful for PHP development.&lt;/p&gt;

&lt;h3&gt;
  
  
  PHP Intelephense
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client" rel="noopener noreferrer"&gt;PHP Intelephense extension&lt;/a&gt; enables advanced code analysis and gives you context about methods, variables, classes and other components in a PHP application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9pn8jj7aol0v9tc1bo09.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9pn8jj7aol0v9tc1bo09.png" alt="PHP Intelephense"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;p&gt;ext &lt;span class="nb"&gt;install &lt;/span&gt;bmewburn.vscode-intelephense-client&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  PHP Getters and Setters&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://marketplace.visualstudio.com/items?itemName=phproberto.vscode-php-getters-setters" rel="noopener noreferrer"&gt;PHP getters and setters&lt;/a&gt; extension enables you to quickly generate getter and setter methods on a PHP class, based on its properties.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;p&gt;ext &lt;span class="nb"&gt;install &lt;/span&gt;phproberto.vscode-php-getters-setters&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  PHP Namespace Resolver&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://marketplace.visualstudio.com/items?itemName=MehediDracula.php-namespace-resolver" rel="noopener noreferrer"&gt;PHP namespace resolver&lt;/a&gt; extension facilitates importing classes and also allows you to easily order your &lt;code&gt;use&lt;/code&gt; statements by line length or in alphabetical order.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;p&gt;ext &lt;span class="nb"&gt;install &lt;/span&gt;MehediDracula.php-namespace-resolver&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Laravel Artisan&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://marketplace.visualstudio.com/items?itemName=ryannaddy.laravel-artisan" rel="noopener noreferrer"&gt;Laravel Artisan extension&lt;/a&gt; allows you to run Artisan commands from within your VS Code.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;p&gt;ext &lt;span class="nb"&gt;install &lt;/span&gt;ryannaddy.laravel-artisan&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Conclusion&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;In this post, we saw how to install and customize VS Code for a better coding experience suited to your individual needs. We also saw some useful extensions for productivity, and a few PHP extensions that can help you improve your development speed in that language.&lt;/p&gt;

&lt;p&gt;Give these extensions a try, and if some don't turn out to be useful you can quickly deactivate them through the Extensions tab (the fifth icon on the top left menu).&lt;/p&gt;

&lt;p&gt;Have feedback or questions about the Sourcegraph VS Code extension? Leave a comment, or join our &lt;a href="https://about.sourcegraph.com/community/?utm_medium=social&amp;amp;utm_source=devto&amp;amp;utm_campaign=slacklaunch" rel="noopener noreferrer"&gt;Community Slack Space&lt;/a&gt; where our team will be happy to answer any questions you may have.&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Simple &amp; Advanced Search in VS Code with Sourcegraph</title>
      <dc:creator>Prosper Otemuyiwa</dc:creator>
      <pubDate>Thu, 10 Feb 2022 19:15:55 +0000</pubDate>
      <link>https://dev.to/sourcegraph/simple-advanced-search-in-vs-code-with-sourcegraph-29if</link>
      <guid>https://dev.to/sourcegraph/simple-advanced-search-in-vs-code-with-sourcegraph-29if</guid>
      <description>&lt;p&gt;The hallmark of fast and productive developers is finding and deploying resources quickly to succeed in their projects. Software is eating the world. The rapid digital transformation has led to countless innovations &amp;amp; services that improve people's lives all over the world. However, it's not been easy for developers.&lt;/p&gt;

&lt;p&gt;Sourcegraph universal code search enables developers to find and fix things fast across the complex universe of interdependent codebases – various programming languages, code hosts, repositories, version control systems, services, and APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simple and Advanced Search in VS Code
&lt;/h2&gt;

&lt;p&gt;Sourcegraph released a VS Code extension that enables any developer to search over two million open source repositories right from inside VS Code IDE—for free.&lt;/p&gt;

&lt;p&gt;With Sourcegraph for VS Code, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn from open source code examples&lt;/li&gt;
&lt;li&gt;Search best practices&lt;/li&gt;
&lt;li&gt;Copy and paste code from open-source land. &lt;/li&gt;
&lt;li&gt;Sync your private code and search it within VS Code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to Install Sourcegraph VS Code Extension
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open VS Code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Search for "Sourcegraph for VS Code" in the extensions marketplace. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644325588%2FCleanShot_2022-02-08_at_13.59.35_2x_jayl3x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644325588%2FCleanShot_2022-02-08_at_13.59.35_2x_jayl3x.png" alt="Search for Sourcegraph Extension"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; An alternative way is to &lt;a href="https://marketplace.visualstudio.com/items?itemName=sourcegraph.sourcegraph" rel="noopener noreferrer"&gt;install directly from the VS Code marketplace&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on the wildcard icon on the Activity Bar to launch the extension, as shown in the image below:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644326017%2FCleanShot_2022-02-08_at_14.12.40_2x_ndyxlf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644326017%2FCleanShot_2022-02-08_at_14.12.40_2x_ndyxlf.png" alt="Click on the Sourcegraph wildcard icon"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search for code!&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Code Search with Sourcegraph in VS Code
&lt;/h2&gt;

&lt;p&gt;Sourcegraph supports three modes of code search:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Literal&lt;/li&gt;
&lt;li&gt;Regular Expression&lt;/li&gt;
&lt;li&gt;Structural &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Literal Search in VS Code
&lt;/h3&gt;

&lt;p&gt;Sourcegraph allows you to search for the exact string you are looking for in the codebase in a literal search pattern. For example, you can find function calls, comments, error messages, etc.&lt;/p&gt;

&lt;p&gt;With literal Search, you can find function calls, error messages, comments, notes etc. For instance, if you want to search for "palindrome" you can search like so:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Search for palindrome code samples&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644328351%2FCleanShot_2022-02-08_at_14.50.33_t33ozi.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644328351%2FCleanShot_2022-02-08_at_14.50.33_t33ozi.gif" alt="Palindrome search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For more info, check out a &lt;a href="https://learn.sourcegraph.com/how-to-search-code-with-sourcegraph-using-literal-patterns" rel="noopener noreferrer"&gt;detailed article about literal expression search on Sourcegraph&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Regular Expression Search in VS Code
&lt;/h3&gt;

&lt;p&gt;Sourcegraph enables the mode to harness regular expression in code search. You need to allow the regular expression mode on the search box by clicking on the &lt;code&gt;*&lt;/code&gt; sign on the right.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644328936%2FCleanShot_2022-02-08_at_15.01.22_bzwail.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644328936%2FCleanShot_2022-02-08_at_15.01.22_bzwail.gif" alt="Enable regex search mode"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Find code samples for the following Promise cases in JavaScript. &lt;code&gt;Promise.any&lt;/code&gt;, &lt;code&gt;Promise.all&lt;/code&gt;, &lt;code&gt;Promise.allSettled&lt;/code&gt; and &lt;code&gt;Promise.case&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644476729%2FCleanShot_2022-02-10_at_08.02.54_gec2ea.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644476729%2FCleanShot_2022-02-10_at_08.02.54_gec2ea.gif" alt="Promise cases"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To learn more, check out a &lt;a href="https://learn.sourcegraph.com/how-to-search-with-sourcegraph-using-regular-expression-patterns" rel="noopener noreferrer"&gt;detailed article about regular expression search on Sourcegraph&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Structural Search in VS Code
&lt;/h3&gt;

&lt;p&gt;Structural Search gives you the ability to copy-paste code blocks into the search box and get accurate results returned.&lt;/p&gt;

&lt;p&gt;First, enable the structural search mode by clicking on the &lt;code&gt;[ ]&lt;/code&gt; sign on the right:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644477222%2FCleanShot_2022-02-10_at_08.12.57_l7feop.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644477222%2FCleanShot_2022-02-10_at_08.12.57_l7feop.gif" alt="Enable Structural Search Mode"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Find code samples of &lt;code&gt;try and catch&lt;/code&gt; in JavaScript code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644477625%2FCleanShot_2022-02-10_at_08.18.09_fmor9x.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644477625%2FCleanShot_2022-02-10_at_08.18.09_fmor9x.gif" alt="Search for try and catch code samples"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To learn more, check out a &lt;a href="https://learn.sourcegraph.com/how-to-search-with-sourcegraph-using-structural-patterns" rel="noopener noreferrer"&gt;detailed article about structural search on Sourcegraph&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Private Code Search in VS Code
&lt;/h2&gt;

&lt;p&gt;The VS Code extension provides private code search. It allows you add and search your own code. To search for private code, you'll need to do the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If you don't have an account on &lt;a href="https://sourcegraph.com?utm_campaign=7015b000005hsb3aae&amp;amp;utm_medium=referral&amp;amp;utm_source=dev.to&amp;amp;utm_content=prosper-vscodesearchpost"&gt;Sourcegraph&lt;/a&gt;, &lt;a href="https://sourcegraph.com/sign-up?utm_campaign=7015b000005hsb3aae&amp;amp;utm_medium=referral&amp;amp;utm_source=dev.to&amp;amp;utm_content=prosper-vscodesearchpost"&gt;create one&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On Sourcegraph Cloud, navigate to &lt;strong&gt;Access tokens&lt;/strong&gt; in your account settings and generate a new token.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644480245%2FCleanShot_2022-02-10_at_09.02.34_2x_rvvfc2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644480245%2FCleanShot_2022-02-10_at_09.02.34_2x_rvvfc2.png" alt="Go to settings"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Settings&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644480175%2FCleanShot_2022-02-10_at_09.01.30_2x_valrkq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644480175%2FCleanShot_2022-02-10_at_09.01.30_2x_valrkq.png" alt="About to generate an access token"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Click to generate access token&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644480583%2FCleanShot_2022-02-10_at_09.07.21_2x_bblmyr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644480583%2FCleanShot_2022-02-10_at_09.07.21_2x_bblmyr.png" alt="Name the access token"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Give the access token a name&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy the newly generated token, and navigate to the Sourcegraph extension.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644480637%2FCleanShot_2022-02-10_at_09.07.56_2x_exl6zo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644480637%2FCleanShot_2022-02-10_at_09.07.56_2x_exl6zo.png" alt="Generated Access token"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Copy the newly generated access token&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paste the token into the &lt;em&gt;access token input field&lt;/em&gt; in the extension's sidebar. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644481092%2FCleanShot_2022-02-10_at_09.17.21_2x_ot8wlg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1644481092%2FCleanShot_2022-02-10_at_09.17.21_2x_ot8wlg.png" alt="Paste the generated access token into Sourcegraph VS Code extension"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Paste the generated access token into Sourcegraph VS Code extension&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Editor will be reloaded automatically to use the newly added token.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Sourcegraph for VS Code brings the power of &lt;a href="https://sourcegraph.com?utm_campaign=7015b000005hsb3aae&amp;amp;utm_medium=referral&amp;amp;utm_source=dev.to&amp;amp;utm_content=prosper-vscodesearchpost"&gt;Sourcegraph query language&lt;/a&gt; into your IDE. Now, you are building &amp;amp; leveraging advanced code search in the same environment. One more step to optimizing your developer productivity!&lt;/p&gt;

&lt;p&gt;You can also run &lt;a href="https://docs.sourcegraph.com/admin/install#self-hosted?utm_campaign=7015b000005hsb3aae&amp;amp;utm_medium=referral&amp;amp;utm_source=dev.to&amp;amp;utm_content=prosper-vscodesearchpost"&gt;Sourcegraph locally&lt;/a&gt;, or opt-in for us to set up a managed Sourcegraph instance for your team. You'll be able to use a self-hosted Sourcegraph instance for free (up to 10 users). &lt;/p&gt;




&lt;p&gt;Have suggestions or questions? Leave a comment, or join our &lt;a href="https://about.sourcegraph.com/community/?utm_campaign=7015b000005hsb3aae&amp;amp;utm_medium=referral&amp;amp;utm_source=dev.to&amp;amp;utm_content=prosper-vscodesearchpost"&gt;Community Slack Space&lt;/a&gt; where our team will be happy to answer any questions you may have about Sourcegraph.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>vscode</category>
      <category>codesearch</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Parsing DEV markdown within a Laravel Tailwind application</title>
      <dc:creator>Erika Heidi</dc:creator>
      <pubDate>Wed, 19 Jan 2022 10:08:29 +0000</pubDate>
      <link>https://dev.to/sourcegraph/parsing-dev-markdown-within-a-laravel-tailwind-application-34ee</link>
      <guid>https://dev.to/sourcegraph/parsing-dev-markdown-within-a-laravel-tailwind-application-34ee</guid>
      <description>&lt;p&gt;In a &lt;a href="https://dev.to/sourcegraph/creating-a-laravel-artisan-command-to-import-posts-from-dev-via-the-command-line-4iak"&gt;previous part of our series&lt;/a&gt;, we saw how to create an Artisan command to import your latest DEV articles and save them as markdown files within the storage folder of your Laravel application. The only thing missing now is to exhibit these posts in the main page of the demo application.&lt;/p&gt;

&lt;p&gt;In this post, you'll learn how to parse the DEV markdown using the &lt;a href="https://github.com/librarianphp/parsed" rel="noopener noreferrer"&gt;librarianphp/parsed&lt;/a&gt; library, which enables support for liquid tags in addition to parsing the front matter to obtain metadata related to the post. You can also watch the &lt;a href="https://youtu.be/DQrPfTPcVms" rel="noopener noreferrer"&gt;recap video on YouTube&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/DQrPfTPcVms"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3gkxscfgzrqweuvgkpd6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3gkxscfgzrqweuvgkpd6.png" alt="Final result - Headless DEV blog demo in Laravel + TailwindCSS"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclaimer: this methodology works only with posts that are created with the classic markdown DEV editor, which uses a &lt;a href="https://dev.to/p/editor_guide"&gt;Jekyll front matter&lt;/a&gt; within the markdown body of the article. If you use the rich editor, you'll need to generate a valid front matter based on the returning API information for each article, before saving them as .md files. This is not covered within this series.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Preparation
&lt;/h2&gt;

&lt;p&gt;Before moving along, make sure you have followed all steps in the &lt;a href="https://dev.to/sourcegraph/creating-a-new-laravel-application-with-sail-and-docker-no-php-required-4c2n"&gt;previous tutorials of the series&lt;/a&gt; in order to bootstrap your Laravel application and development environment, to create the basic front-end view, and to create an Artisan command to import posts from DEV. This will require you to have Docker, Curl, and Git installed on your system.&lt;/p&gt;

&lt;p&gt;This tutorial assumes that you have an alias to &lt;code&gt;./vendor/bin/sail&lt;/code&gt; on the root of the application folder, so that you can run Sail with &lt;code&gt;./sail&lt;/code&gt;. You can create such an alias with the following commands, executed from the application root folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ./vendor/bin/sail sail
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x sail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you haven't yet, bring your environment up with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./vendor/bin/sail up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will start up your environment and keep it running in the background. Your Laravel application should now be available at &lt;code&gt;http://localhost&lt;/code&gt; from your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Installing Parsed via Composer
&lt;/h2&gt;

&lt;p&gt;To parse the content imported from DEV, we'll use &lt;a href="https://github.com/librarianphp/parsed" rel="noopener noreferrer"&gt;librarianphp/parsed&lt;/a&gt;, a library based on &lt;a href="https://packagist.org/packages/league/commonmark" rel="noopener noreferrer"&gt;league/commonmark&lt;/a&gt; that parses the metadata content from traditional DEV posts that use the Jekyll front matter, in addition to parsing liquid tags and allowing you to implement your own custom liquid tags. &lt;/p&gt;

&lt;p&gt;Run the following command to include &lt;code&gt;librarianphp/parsed&lt;/code&gt; as a Composer dependency:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./sail composer require librarianphp/parsed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the dependencies are installed, you can move on to the next step.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Fetching the list of posts from local markdown files
&lt;/h2&gt;

&lt;p&gt;If you followed along with all tutorials in this series, you should now have your DEV articles as &lt;code&gt;.md&lt;/code&gt; files in the local application storage folder,  &lt;code&gt;storage/app&lt;/code&gt;. Now you'll need to create a list with your most recent posts and make the list available to the front-end view so that you can exhibit your posts on the main application page.&lt;/p&gt;

&lt;p&gt;We'll need to modify the &lt;code&gt;routes/web.php&lt;/code&gt; file, since that is where you have your main route defined. Open this file in your code editor.&lt;/p&gt;

&lt;p&gt;The following code uses the &lt;code&gt;glob()&lt;/code&gt; function to loop through all files in the specified directory, which is defined with the help of the &lt;code&gt;storage_path()&lt;/code&gt; helper function. This function will return the absolute path for directories inside your storage folder. When specifying the search pattern, we use a &lt;code&gt;/*.md&lt;/code&gt; filter to make sure we skip any files that aren't markdown files. Then, we create a &lt;code&gt;Content&lt;/code&gt; object by loading the contents from each file, and add that object to an array called &lt;code&gt;articles&lt;/code&gt;. We then use the &lt;code&gt;krsort&lt;/code&gt; method to order the array in reverse order, which will bring your latest articles first in the list. We also use the &lt;code&gt;array_slice()&lt;/code&gt; function to keep a fixed number of results, defined by the variable &lt;code&gt;limit&lt;/code&gt; which is set to &lt;code&gt;10&lt;/code&gt; by default. Finally, we return the template view, passing in the list of articles so that it can be used in a loop.&lt;/p&gt;

&lt;p&gt;You can replace the current content on your &lt;code&gt;routes/web.php&lt;/code&gt; with the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Support\Facades\Route&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Parsed\Content&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Parsed\ContentParser&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="cm"&gt;/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/&lt;/span&gt;

&lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nv"&gt;$articles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
   &lt;span class="nv"&gt;$limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

   &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;glob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;storage_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'app'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s1"&gt;'/*.md'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nv"&gt;$article&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;file_get_contents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
       &lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ContentParser&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

       &lt;span class="nv"&gt;$articles&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="nb"&gt;krsort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$articles&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="nv"&gt;$articles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;array_slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$articles&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$limit&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;view&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'index'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
       &lt;span class="s1"&gt;'articles'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$articles&lt;/span&gt;
   &lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file when you're done.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Listing the posts on the application's main page
&lt;/h2&gt;

&lt;p&gt;If you reload the application on your browser now, nothing has changed, since you still need to update your main front-end view to list the content obtained in the previous step. The content was passed along to the front-end view in an array named &lt;code&gt;articles&lt;/code&gt;, so we'll need to loop through this array in order to show each article's summary.&lt;/p&gt;

&lt;p&gt;Open the index view file at &lt;code&gt;resources/views/index.blade.php&lt;/code&gt; on your code editor. Locate the main content area, where the example posts are statically defined. You can remove the static posts because you're going to replace them with a &lt;code&gt;foreach&lt;/code&gt; Blade loop.&lt;/p&gt;

&lt;p&gt;Each item in the &lt;code&gt;articles&lt;/code&gt; array is an object of type &lt;code&gt;Parsed\Content&lt;/code&gt;. This object is a wrapper around markdown content using the Jekyll front matter format to define metadata about the content, such as title, cover image, and tags. All items defined in the content's front matter are available through a method called &lt;code&gt;frontMatterGet()&lt;/code&gt;. To check if a metadata information exists, you can use the method &lt;code&gt;frontMatterHas()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The following piece of Blade-compatible code loops through the &lt;code&gt;articles&lt;/code&gt; array to exhibit a summary of each post. It checks whether a &lt;code&gt;cover_image&lt;/code&gt; property is set within the frontmatter of the article. When this property is not present, it will use a random image from &lt;a href="https://picsum.com" rel="noopener noreferrer"&gt;Lorem Picsum&lt;/a&gt; to illustrate the post. For simplicity, the code assumes that &lt;code&gt;title&lt;/code&gt;,  &lt;code&gt;description&lt;/code&gt;, and &lt;code&gt;tags&lt;/code&gt; are always set:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;   &lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$articles&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
       &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt; &lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"mb-10"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
           &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt; &lt;span class="n"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=@&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;frontMatterHas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'cover_image'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
                      &lt;span class="s2"&gt;"{{ &lt;/span&gt;&lt;span class="nv"&gt;$article-&amp;gt;frontMatterGet&lt;/span&gt;&lt;span class="s2"&gt;('cover_image') }}"&lt;/span&gt;
                    &lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s2"&gt;"https://picsum.photos/1000/420"&lt;/span&gt;
                    &lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="k"&gt;endif&lt;/span&gt; &lt;span class="n"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Post header image"&lt;/span&gt; &lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"rounded-lg my-4"&lt;/span&gt;
            &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
           &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;h1&lt;/span&gt; &lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"text-4xl mb-4"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;frontMatterGet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'title'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
           &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"text-md"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;frontMatterGet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'description'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
           &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nc"&gt;Posted&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;span&lt;/span&gt; &lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"text-gray-700 font-bold"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;frontMatterGet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'tags'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;span&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
       &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="k"&gt;endforeach&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the &lt;a href="https://sourcegraph.com/github.com/sourcegraph-community/laravel-dev-blog/-/blob/resources/views/index.blade.php" rel="noopener noreferrer"&gt;fully updated &lt;code&gt;index.blade.php&lt;/code&gt; file&lt;/a&gt; for your reference:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"utf-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

   &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;My DEV Blog&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"description"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"My DEV Blog"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"author"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"Sourcegraph"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

   &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:title"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"A headless blog in Laravel"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:type"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"website"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:url"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"https://github.com/sourcegraph-community/laravel-dev-blog"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:description"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"A demo Laravel blog"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

   &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"{{ asset('css/app.css') }}"&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;body&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"bg-gradient-to-r from-blue-600 via-pink-500 to-purple-900"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

   &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container text-white mx-auto mt-6"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
       &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"grid grid-cols-3 gap-4"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
           &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
               &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-3xl"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;My DEV Blog: latest posts&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
           &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
           &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"col-span-2 text-right"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
               menu
           &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
       &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

   &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container mx-auto px-10 py-10 bg-gray-100 my-10 text-gray-600 rounded-md shadow-md"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
       &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"grid grid-cols-3 gap-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
           &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"col-span-2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
               @foreach ($articles as $article)
                   &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mb-10"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                       &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;@if&lt;/span&gt; &lt;span class="err"&gt;($&lt;/span&gt;&lt;span class="na"&gt;article-&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;frontMatterHas('cover_image'))
                                   "{{ $article-&amp;gt;frontMatterGet('cover_image') }}"
                                @else "https://picsum.photos/1000/420"
                                @endif alt="Post header image" class="rounded-lg my-4"
                        /&amp;gt;
                       &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-4xl mb-4"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{ $article-&amp;gt;frontMatterGet('title') }}&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
                       &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-md"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{ $article-&amp;gt;frontMatterGet('description') }}&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
                       &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Posted in: &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-gray-700 font-bold"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{ $article-&amp;gt;frontMatterGet('tags') }}&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
                   &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
               @endforeach
           &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

           &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
               &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://picsum.photos/100"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"rounded-full mx-auto p-4"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"avatar"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
               &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-gray-700 text-xl mb-10"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Hi, I'm a demo Laravel application built with Tailwind CSS, pulling content from DEV.to.
                   You can find my code &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-purple-800 font-bold"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://github.com/sourcegraph-community/laravel-dev-blog"&lt;/span&gt; &lt;span class="na"&gt;title=&lt;/span&gt;&lt;span class="s"&gt;"Laravel DEV blog demo on GitHub"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;here&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt; and you can learn more about me &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-purple-800 font-bold"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://dev.to/sourcegraph/creating-a-new-laravel-application-with-sail-and-docker-no-php-required-4c2n"&lt;/span&gt; &lt;span class="na"&gt;title=&lt;/span&gt;&lt;span class="s"&gt;"Getting started with Laravel tutorial series"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;here&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

               &lt;span class="nt"&gt;&amp;lt;h2&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-gray-400 text-2xl"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Links&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;

               &lt;span class="nt"&gt;&amp;lt;ul&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"py-2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                   &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"py-2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"px-1 py-2 bg-purple-300"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://github.com/sourcegraph-community/laravel-dev-blog"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Demo Laravel DEV Blog on GitHub&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
                   &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"py-2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"px-1 py-2 bg-pink-400"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://dev.to/sourcegraph/creating-a-new-laravel-application-with-sail-and-docker-no-php-required-4c2n"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Getting started with Laravel on DEV&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
                   &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"py-2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"px-1 py-2 bg-purple-300"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://laravel.com/docs/8.x"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Laravel Documentation&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
                   &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"py-2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"px-1 py-2 bg-pink-400"&lt;/span&gt;  &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://tailwindcss.com/docs/installation"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;TailwindCSS Documentation&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
                   &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"py-2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"px-1 py-2 bg-purple-300"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://php.net"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Official PHP Documentation&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
                   &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"py-2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"px-1 py-2 bg-pink-400"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://sourcegraph.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Sourcegraph Code Search&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
               &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
           &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
       &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The sidebar was also slightly updated with a few resourceful links to improve the overall appearance of the page. Once you save the template and reload the application on your browser, you should see a page similar to this, but showcasing your own DEV articles:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F11n8mjs0v632vaavymht.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F11n8mjs0v632vaavymht.gif" alt="Animated gif showing the final result of the demo headless DEV blog built with Laravel and TailwindCSS"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, which is the fourth and last part of our &lt;em&gt;Getting started with Laravel&lt;/em&gt; series, we've seen how to create a collection of DEV.to markdown posts and parse them using the &lt;a href="https://github.com/librarianphp/parsed" rel="noopener noreferrer"&gt;librarianphp/parsed&lt;/a&gt; library.&lt;/p&gt;

&lt;p&gt;The demo application is open source and fully &lt;a href="https://github.com/sourcegraph-community/laravel-dev-blog" rel="noopener noreferrer"&gt;available on GitHub&lt;/a&gt;. Feel free to clone or fork the project to create a custom version that better suits your needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Helpful Resources
&lt;/h3&gt;

&lt;p&gt;Check the following list with useful resources to learn more about the open source projects and libraries used in this series:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://laravel.com/docs/8.x/installation" rel="noopener noreferrer"&gt;Laravel documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tailwindcss.com/docs/installation" rel="noopener noreferrer"&gt;TailwindCSS documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.minicli.dev/en/latest/xtras/extending-minicli/#miniclicurly" rel="noopener noreferrer"&gt;Curly&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/librarianphp/parsed" rel="noopener noreferrer"&gt;Parsed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/p/editor_guide"&gt;DEV.to front matter and markdown reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.forem.com/api#tag/articles" rel="noopener noreferrer"&gt;DEV.to API reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sourcegraph.com/search?q=context:global+https://dev.to/api/articles%3Fusername%3D&amp;amp;patternType=literal"&gt;Search code examples using the DEV API to fetch articles&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;You can follow &lt;a href="https://twitch.tv/sourcegraph" rel="noopener noreferrer"&gt;Sourcegraph on Twitch&lt;/a&gt; to be notified when we go live. Follow our &lt;a href="https://youtube.com/c/sourcegraph" rel="noopener noreferrer"&gt;YouTube channel&lt;/a&gt; for the full recap videos of our livestreams.&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>8 Sourcegraph Search Query Features You Should Know About</title>
      <dc:creator>Prosper Otemuyiwa</dc:creator>
      <pubDate>Mon, 03 Jan 2022 09:01:51 +0000</pubDate>
      <link>https://dev.to/sourcegraph/8-sourcegraph-search-query-features-you-should-know-about-1gmc</link>
      <guid>https://dev.to/sourcegraph/8-sourcegraph-search-query-features-you-should-know-about-1gmc</guid>
      <description>&lt;p&gt;&lt;a href="https://sourcegraph.com" rel="noopener noreferrer"&gt;Sourcegraph&lt;/a&gt; is a search tool that enables developers to search, explore and better understand all of their public and private code. It supercharges developer productivity and automates large-scale code changes. &lt;/p&gt;

&lt;p&gt;In this article, I’ll explore some Sourcegraph search gems with you. &lt;/p&gt;

&lt;p&gt;Here are 8 Sourcegraph search features you should know about!&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Literal Expression Search
&lt;/h2&gt;

&lt;p&gt;By default, all search queries on Sourcegraph are treated as literal patterns. If you know the exact string you’re looking for in the codebase, then all you need to do is paste it in the query box and search.&lt;/p&gt;

&lt;p&gt;Sourcegraph interprets this search pattern literally (as the name defines it) to simplify searching for words or punctuation in your codebase.&lt;/p&gt;

&lt;p&gt;With literal search, you can find function calls, error messages, comments, notes etc. For instance, if you want to search for how to use the &lt;em&gt;browser navigator clipboard API&lt;/em&gt;, you can simply use:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

navigator.clipboard


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Search Query:&lt;/strong&gt; &lt;a href="https://sourcegraph.com/search?q=context:global+navigator.clipboard&amp;amp;patternType=literal" rel="noopener noreferrer"&gt;https://sourcegraph.com/search?q=context:global+navigator.clipboard&amp;amp;patternType=literal&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641198704%2Fnavigator-clipboard.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641198704%2Fnavigator-clipboard.gif" alt="Navigator Clipboard search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For more info, check out a &lt;a href="https://learn.sourcegraph.com/how-to-search-code-with-sourcegraph-using-literal-patterns" rel="noopener noreferrer"&gt;detailed article about literal expression search on Sourcegraph&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Regular Expression Search
&lt;/h2&gt;

&lt;p&gt;Sourcegraph’s query language is very powerful. One of its strengths is in the regular expression search it provides.&lt;/p&gt;

&lt;p&gt;On the search box, you need to enable the regular expression mode by clicking on the &lt;code&gt;*&lt;/code&gt; sign on the right.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641196727%2Funnamed_2_zfgnmo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641196727%2Funnamed_2_zfgnmo.gif" alt="Enable regular expression"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the regex mode is enabled, you can start using regular expressions for advanced search patterns. You can also add &lt;code&gt;patterntype:regexp&lt;/code&gt; to your queries and this will automatically enable regex mode.  &lt;/p&gt;

&lt;p&gt;Let's see a few different use cases of regex search as examples.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Find how the filesync &lt;code&gt;readFile&lt;/code&gt; and &lt;code&gt;writeFile&lt;/code&gt; methods are used in several projects.&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

fs\.(read|write)File patterntype:regexp 


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Search Query:&lt;/strong&gt; &lt;a href="https://sourcegraph.com/search?q=context:global+fs%5C.%28read%7Cwrite%29File&amp;amp;patternType=regexp" rel="noopener noreferrer"&gt;https://sourcegraph.com/search?q=context:global+fs%5C.%28read%7Cwrite%29File&amp;amp;patternType=regexp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641200216%2Fread-write-file-search.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641200216%2Fread-write-file-search.gif" alt="Read write file search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Find real-life use cases for &lt;code&gt;Promise.all&lt;/code&gt;, &lt;code&gt;Promise.any&lt;/code&gt;, &lt;code&gt;Promise.race&lt;/code&gt;, and &lt;code&gt;Promise.allSettled&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Promise.(any|race|allSettled) lang:JavaScript patterntype:regexp


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Search Query:&lt;/strong&gt; &lt;a href="https://sourcegraph.com/search?q=context:global+Promise.%28any%7Crace%7CallSettled%29+lang:JavaScript&amp;amp;patternType=regexp" rel="noopener noreferrer"&gt;https://sourcegraph.com/search?q=context:global+Promise.%28any%7Crace%7CallSettled%29+lang:JavaScript&amp;amp;patternType=regexp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199017%2Fpromise-js-search.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199017%2Fpromise-js-search.gif" alt="Promise search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out a &lt;a href="https://learn.sourcegraph.com/how-to-search-with-sourcegraph-using-regular-expression-patterns" rel="noopener noreferrer"&gt;detailed article about the regular expression search on Sourcegraph&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Structural Search
&lt;/h2&gt;

&lt;p&gt;Structural search gives you wings as a developer. With structural search, you can copy-paste blocks of code into the Sourcegraph search box, and accurate results will be returned.&lt;/p&gt;

&lt;p&gt;First, enable the structural search mode by clicking on the &lt;code&gt;[ ]&lt;/code&gt; sign on the right:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199976%2Fenable-structural-search.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199976%2Fenable-structural-search.gif" alt="Enable Structural search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then you can go ahead and perform a structural search like so:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

"exclude": [...] lang:json file:tsconfig.json patterntype:structural


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Search Query:&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://sourcegraph.com/search?q=context:global+%22exclude%22:+%5B...%5D+lang:json+file:tsconfig.json&amp;amp;patternType=structural" rel="noopener noreferrer"&gt;https://sourcegraph.com/search?q=context:global+%22exclude%22:+%5B...%5D+lang:json+file:tsconfig.json&amp;amp;patternType=structural&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199948%2Fexclude-structural-search.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199948%2Fexclude-structural-search.gif" alt="Structural search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To learn more, check out a &lt;a href="https://learn.sourcegraph.com/how-to-search-with-sourcegraph-using-structural-patterns" rel="noopener noreferrer"&gt;detailed article about structural search on Sourcegraph&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Diff Search
&lt;/h2&gt;

&lt;p&gt;Diff search allows you to search for code in file diffs. It makes it easy for a developer to search for code that used to exist and compare it with code that presently exists.&lt;/p&gt;

&lt;p&gt;For example, the following search…&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

repo:^github\.com/sourcegraph/sourcegraph$ type:diff matrix


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Search Query:&lt;/strong&gt; &lt;a href="https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+type:diff+matrix&amp;amp;patternType=literal" rel="noopener noreferrer"&gt;https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+type:diff+matrix&amp;amp;patternType=literal&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199855%2Fdiff-search.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199855%2Fdiff-search.gif" alt="Diff search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Commit Search
&lt;/h2&gt;

&lt;p&gt;Commit search allows you to search for specific strings used in commit messages across your codebase.&lt;/p&gt;

&lt;p&gt;Let’s search over commit messages like so:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199769%2Fcommit-search.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199769%2Fcommit-search.gif" alt="Commit search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Search Contexts
&lt;/h2&gt;

&lt;p&gt;Search contexts are a set of repositories at specific revisions that search queries on Sourcegraph will target. &lt;/p&gt;

&lt;p&gt;In other words, search contexts enable you to narrow, group and search only the code repositories you care about.&lt;/p&gt;

&lt;p&gt;By default, Sourcegraph uses a global search context (namely, &lt;strong&gt;context:global&lt;/strong&gt;) for all search queries, when no search context is specified by the actor (me, you, or a programmable robot) performing the search.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641198531%2Fsearch-contexts-chakra.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641198531%2Fsearch-contexts-chakra.gif" alt="Search contexts"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To learn more, check out a &lt;a href="https://dev.to/sourcegraph/how-to-use-search-contexts-on-sourcegraph-138n"&gt;detailed article about creating, and using search contexts on Sourcegraph&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Symbol Search
&lt;/h2&gt;

&lt;p&gt;Symbol search comes in handy when you want to directly search for function, class, variable and const definitions in your code search.&lt;/p&gt;

&lt;p&gt;With Sourcegraph, you can use the “type:symbol” filter in your search query like so:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

repo:^github\.com/sourcegraph/sourcegraph$ type:symbol Vector


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The search query returns the symbol you searched for. All the symbols in that particular repository or file are grouped and shown on the left-hand side.&lt;/p&gt;

&lt;p&gt;The grouped symbol list is searchable as shown in the gif below. You can search for whatever symbol you want.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Sourcegraph has Symbol support for 75+  languages&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641198656%2Fsymbol-search.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641198656%2Fsymbol-search.gif" alt="Symbol search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Branch &amp;amp; Tag Search
&lt;/h2&gt;

&lt;p&gt;Sourcegraph makes it possible to search for code in all of your branches and tags. Yes, all your branches, not only the main branch!&lt;/p&gt;

&lt;h3&gt;
  
  
  Branch Search
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Search the “add-panel-zoekt-cap” branch of the &lt;a href="https://github.com/sourcegraph/sourcegraph" rel="noopener noreferrer"&gt;sourcegraph/sourcegraph repo&lt;/a&gt; for webhook.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Search Query:&lt;/strong&gt; &lt;a href="https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+rev:*refs/heads/add-panel-zoekt-cap+webhook&amp;amp;patternType=literal" rel="noopener noreferrer"&gt;https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+rev:*refs/heads/add-panel-zoekt-cap+webhook&amp;amp;patternType=literal&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199027%2Ftag-webhook-search.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199027%2Ftag-webhook-search.gif" alt="Tag search for webhook"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Tag Search
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Use Case:&lt;/strong&gt; Search the “v3.32.0-rc.2” tag of the &lt;a href="https://github.com/sourcegraph/sourcegraph" rel="noopener noreferrer"&gt;https://github.com/sourcegraph/sourcegraph repo&lt;/a&gt; for batch changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Search Query:&lt;/strong&gt; &lt;a href="https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+rev:*refs/tags/v3.32.0-rc.2+batch+changes&amp;amp;patternType=literal" rel="noopener noreferrer"&gt;https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+rev:*refs/tags/v3.32.0-rc.2+batch+changes&amp;amp;patternType=literal&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199042%2Ftags-batch-changes-search.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Funicodeveloper%2Fimage%2Fupload%2Fv1641199042%2Ftags-batch-changes-search.gif" alt="Tag search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The benefits of code search are innumerable. The faster you can find code, the higher the development velocity for you and your teammates.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sourcegraph.com" rel="noopener noreferrer"&gt;Sourcegraph Cloud&lt;/a&gt; is not the only option to add, explore private code and use search contexts. Sourcegraph can be installed in different ways to give you advanced search features for your private code. &lt;/p&gt;

&lt;p&gt;You can run &lt;a href="https://docs.sourcegraph.com/admin/install#self-hosted" rel="noopener noreferrer"&gt;Sourcegraph locally&lt;/a&gt; or opt-in for us to set up a &lt;a href="https://docs.sourcegraph.com/admin/install/managed" rel="noopener noreferrer"&gt;managed Sourcegraph instance&lt;/a&gt; for your team. You'll be able to use a self-hosted Sourcegraph instance for free (up to 10 users).&lt;/p&gt;




&lt;p&gt;Have suggestions or questions? Leave a comment, or join our &lt;a href="https://about.sourcegraph.com/community/?utm_medium=social&amp;amp;utm_source=devto&amp;amp;utm_campaign=slacklaunch" rel="noopener noreferrer"&gt;Community Slack Space&lt;/a&gt; where our team will be happy to answer any questions you may have about Sourcegraph.&lt;/p&gt;

</description>
      <category>codesearch</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Creating a Laravel Artisan command to import posts from DEV via the command line</title>
      <dc:creator>Erika Heidi</dc:creator>
      <pubDate>Wed, 29 Dec 2021 14:59:29 +0000</pubDate>
      <link>https://dev.to/sourcegraph/creating-a-laravel-artisan-command-to-import-posts-from-dev-via-the-command-line-4iak</link>
      <guid>https://dev.to/sourcegraph/creating-a-laravel-artisan-command-to-import-posts-from-dev-via-the-command-line-4iak</guid>
      <description>&lt;p&gt;In a &lt;a href="https://dev.to/sourcegraph/setting-up-tailwindcss-30-on-a-laravel-project-1cb8"&gt;previous part of our series&lt;/a&gt;, we saw how to install and configure TailwindCSS 3.0 within a Laravel project and how to set up a basic blog layout for our demo application. With that base template in place, the fourth part of the series is focused on the back-end side of the application.&lt;/p&gt;

&lt;p&gt;In this post, you'll learn how to create an Artisan command in Laravel to import posts from DEV using their API and how to save the content as markdown files in your local application storage folder. This recap is also available as a video that you can &lt;a href="https://www.youtube.com/watch?v=Y0WojCCI60I"&gt;watch on YouTube&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Y0WojCCI60I"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Preparation
&lt;/h2&gt;

&lt;p&gt;Before moving along, make sure you have followed all steps in the &lt;a href="https://dev.to/sourcegraph/creating-a-new-laravel-application-with-sail-and-docker-no-php-required-4c2n"&gt;first tutorial of the series&lt;/a&gt; in order to bootstrap your Laravel application and development environment. This will require you to have Docker, Curl, and Git installed on your system.&lt;/p&gt;

&lt;p&gt;If you haven't yet, bring your environment up with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./vendor/bin/sail up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will start up your environment and keep it running in the background. Your Laravel application should now be available at &lt;code&gt;http://localhost&lt;/code&gt; from your browser.&lt;/p&gt;

&lt;p&gt;This tutorial assumes that you have an alias to &lt;code&gt;./vendor/bin/sail&lt;/code&gt; on the root of the application folder, so that you can run Sail with &lt;code&gt;./sail&lt;/code&gt;. You can create such an alias with the following commands, executed from the application root folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ./vendor/bin/sail sail
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x sail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  1. Creating a new Artisan command
&lt;/h2&gt;

&lt;p&gt;Start by creating a new Artisan command using the &lt;code&gt;make:command&lt;/code&gt; utility. This will create a new file with boilerplate code for an Artisan command, saved at &lt;code&gt;app/Console/Commands/&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./sail artisan make:command ImportPosts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the newly generated file &lt;code&gt;app/Console/Commands/ImportPosts.php&lt;/code&gt; in your code editor, and you'll see content like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Console\Commands&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Console\Command&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ImportPosts&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Command&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="cd"&gt;/**
    * The name and signature of the console command.
    *
    * @var string
    */&lt;/span&gt;
   &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$signature&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'command:name'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

   &lt;span class="cd"&gt;/**
    * The console command description.
    *
    * @var string
    */&lt;/span&gt;
   &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Command description'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

   &lt;span class="cd"&gt;/**
    * Create a new command instance.
    *
    * @return void
    */&lt;/span&gt;
   &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
   &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;parent&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="cd"&gt;/**
    * Execute the console command.
    *
    * @return int
    */&lt;/span&gt;
   &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
   &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start by changing the &lt;code&gt;command:name&lt;/code&gt; for the command signature you'd like to use. In this demo we'll use &lt;code&gt;import:dev&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;handle()&lt;/code&gt; method is where the command action happens; this is what will be executed when you run &lt;code&gt;artisan import:dev&lt;/code&gt; from the command line.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Obtaining latest posts from the DEV API
&lt;/h2&gt;

&lt;p&gt;Luckily for us, DEV has an &lt;a href="https://developers.forem.com/api#operation/getArticles"&gt;API&lt;/a&gt; that we can query to obtain the latest posts from a user, without the need to use an authorization token, since that is all public data. The endpoint we want to query is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://dev.to/api/articles?username=DEV_USERNAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make the request, we'll  use &lt;a href="https://docs.minicli.dev/en/latest/xtras/extending-minicli/#miniclicurly"&gt;minicli/curly&lt;/a&gt;, which is a small PHP library based on &lt;code&gt;curl&lt;/code&gt;. Require that dependency with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./sail composer require minicli/curly
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have the dependency installed, add a &lt;code&gt;use&lt;/code&gt; directive at the top of the file so that you can easily reference &lt;code&gt;Minicli\Curly\Client&lt;/code&gt; in your code. We'll also use Laravel's &lt;code&gt;Carbon/Carbon&lt;/code&gt; library to parse the article's publish date, so you should include that within your &lt;code&gt;use&lt;/code&gt; directives as well. Lastly, include the &lt;code&gt;Illuminate\Support\Facades\Storage&lt;/code&gt; class with another &lt;code&gt;use&lt;/code&gt; directive, since we'll be using this facade class to check and save files within the local file storage system. &lt;/p&gt;

&lt;p&gt;This is how the first lines of your &lt;code&gt;app/Console/Commands/ImportDev.php&lt;/code&gt; file should look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Console\Commands&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Console\Command&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Minicli\Curly\Client&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Support\Facades\Storage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Carbon\Carbon&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, update your &lt;code&gt;handle()&lt;/code&gt; method with the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nv"&gt;$crawler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
   &lt;span class="nv"&gt;$headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
       &lt;span class="s1"&gt;'User-Agent: curly 0.1'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="p"&gt;];&lt;/span&gt;

   &lt;span class="nv"&gt;$articles_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$crawler&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://dev.to/api/articles?username=DEV_USERNAME&amp;amp;per_page=10'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$headers&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

   &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$articles_response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'code'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Error while contacting the dev.to API.'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Command&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;FAILURE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="nv"&gt;$articles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$articles_response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'body'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$articles&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nv"&gt;$article_slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'slug'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
       &lt;span class="nv"&gt;$published&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Carbon&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'published_at'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
       &lt;span class="nv"&gt;$filename&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$published&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'YmdH'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s1"&gt;'-'&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$article_slug&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="s1"&gt;'.md'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

       &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Storage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;disk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'local'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$filename&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;

       &lt;span class="nv"&gt;$endpoint&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sprintf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://dev.to/api/articles/%s'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'id'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
       &lt;span class="nv"&gt;$article_query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$crawler&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$endpoint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$headers&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

       &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$article_query&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'code'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="nv"&gt;$article_full&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$article_query&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'body'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

           &lt;span class="nc"&gt;Storage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;disk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'local'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;put&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$filename&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$article_full&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'body_markdown'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

           &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Article saved: "&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$filename&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Command&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;SUCCESS&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code will make a request to the DEV API to obtain a list with the latest &lt;strong&gt;10&lt;/strong&gt; articles from a user. To get the full contents of the article, including the article's metadata defined in the front matter, we'll make a second request once we check that the article hasn't been imported before. Then, we'll use the &lt;code&gt;Storage&lt;/code&gt; utility to save the &lt;code&gt;body_markdown&lt;/code&gt; of each article as a markdown file in the application's storage folder. The files are saved using a combination of the article's publish date and the article slug as filename, with the &lt;code&gt;.md&lt;/code&gt; extension.&lt;/p&gt;

&lt;p&gt;Don't forget to change &lt;strong&gt;DEV_USERNAME&lt;/strong&gt; to your own username on DEV.to.&lt;/p&gt;

&lt;p&gt;Save the file when you're finished.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Test the command to import posts from DEV
&lt;/h2&gt;

&lt;p&gt;With the command ready, you can now run it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./sail artisan import:dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Article saved: 2021121515-setting-up-tailwindcss-30-on-a-laravel-project-1cb8.md
Article saved: 2021121013-creating-a-new-laravel-application-with-sail-and-docker-no-php-required-4c2n.md
Article saved: 2021120318-how-to-set-up-elgatos-stream-deck-on-ubuntu-linux-2110-pdh.md
Article saved: 2021112011-dynamic-twitter-header-images-with-dynacover-github-action-35nb.md
Article saved: 2021111818-how-to-build-github-actions-in-php-with-minicli-and-docker-1k6m.md
Article saved: 2021111618-automatically-update-your-contributors-file-with-this-github-action-workflow-d98.md
Article saved: 2021102717-10-sourcegraph-search-tricks-for-open-source-contributors-and-maintainers-44n9.md
Article saved: 2021092715-3d-design-creating-printable-solid-shapes-from-svg-files-with-inkscape-and-freecad-266e.md
Article saved: 2021090615-3d-design-with-freecad-part-2-working-with-sketcher-part-design-workbenches-3leo.md
Article saved: 2021090614-an-introduction-to-3d-design-with-freecad-part-1-navigation-3gjo.md

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the titles of your latest posts showing up in the output of the command. Once the command is finished running, have a look at your &lt;code&gt;storage/app&lt;/code&gt; folder and you'll see your posts as individual markdown files named after each post's publish date and slug.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls &lt;/span&gt;storage/app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2021090614-an-introduction-to-3d-design-with-freecad-part-1-navigation-3gjo.md
2021090615-3d-design-with-freecad-part-2-working-with-sketcher-part-design-workbenches-3leo.md
2021092715-3d-design-creating-printable-solid-shapes-from-svg-files-with-inkscape-and-freecad-266e.md
2021102717-10-sourcegraph-search-tricks-for-open-source-contributors-and-maintainers-44n9.md
2021111618-automatically-update-your-contributors-file-with-this-github-action-workflow-d98.md
2021111818-how-to-build-github-actions-in-php-with-minicli-and-docker-1k6m.md
2021112011-dynamic-twitter-header-images-with-dynacover-github-action-35nb.md
2021120318-how-to-set-up-elgatos-stream-deck-on-ubuntu-linux-2110-pdh.md
2021121013-creating-a-new-laravel-application-with-sail-and-docker-no-php-required-4c2n.md
2021121515-setting-up-tailwindcss-30-on-a-laravel-project-1cb8.md
public
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, which is part 3 out of 4 in our &lt;em&gt;Getting started with Laravel&lt;/em&gt; series, we've seen how to create an Artisan command and how to import posts from a user of DEV.to using the DEV API and the &lt;code&gt;minicli/curly&lt;/code&gt; library. The command uses the underlying storage system from Laravel to store the posts as individual markdown files in your &lt;code&gt;storage/app&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;In the next part of this series, we'll finish this demo application by updating the index controller and listing the posts on the main application's page.&lt;/p&gt;

&lt;p&gt;You can follow &lt;a href="https://twitch.tv/sourcegraph"&gt;Sourcegraph on Twitch&lt;/a&gt; to be notified when we go live. Follow our &lt;a href="https://youtube.com/c/sourcegraph"&gt;YouTube channel&lt;/a&gt; for the full recap videos of our livestreams.&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>15 Days Of Code Search</title>
      <dc:creator>Prosper Otemuyiwa</dc:creator>
      <pubDate>Wed, 29 Dec 2021 12:03:24 +0000</pubDate>
      <link>https://dev.to/sourcegraph/15-days-of-code-search-1o47</link>
      <guid>https://dev.to/sourcegraph/15-days-of-code-search-1o47</guid>
      <description>&lt;p&gt;Recently, I did a &lt;a href="https://twitter.com/hashtag/15DaysOfSearch"&gt;#15DaysOfSearch Twitter campaign&lt;/a&gt; to show developers how they can optimize their workflow by mastering code search on &lt;a href="https://sourcegraph.com"&gt;sourcegraph.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here's the recap from Day 1 to Day 15:&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 1
&lt;/h3&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;
      &lt;div class="ltag__twitter-tweet__media ltag__twitter-tweet__media__video-wrapper"&gt;
        &lt;div class="ltag__twitter-tweet__media--video-preview"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aAI0sU8O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/tweet_video_thumb/FF79X1FXIAUjB0F.jpg" alt="unknown tweet media content"&gt;
          &lt;img src="/assets/play-butt.svg" class="ltag__twitter-tweet__play-butt" alt="Play butt"&gt;
        &lt;/div&gt;
        &lt;div class="ltag__twitter-tweet__video"&gt;
          
            
          
        &lt;/div&gt;
      &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--hRdEq1CX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1468972181728104458/T0HW_QRJ_normal.jpg" alt="wagmism profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        wagmism
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="mentioned-user" href="https://dev.to/unicodeveloper"&gt;@unicodeveloper&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Today commences the beginning of &lt;a href="https://twitter.com/hashtag/15DaysOfSearch"&gt;#15DaysOfSearch&lt;/a&gt;.&lt;br&gt;&lt;br&gt;I'll show you cool, resourceful &amp;amp; awesome &lt;a href="https://twitter.com/sourcegraph"&gt;@sourcegraph&lt;/a&gt; code search tricks you should be using over the next 15 Days.🤩&lt;br&gt;&lt;br&gt;Day 1: Search for commit messages matching a string “chore” in a repo with the following query: 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      16:11 PM - 06 Dec 2021
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1467889418325397520" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1467889418325397520" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1467889418325397520" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;h3&gt;
  
  
  Day 2
&lt;/h3&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;
      &lt;div class="ltag__twitter-tweet__media ltag__twitter-tweet__media__video-wrapper"&gt;
        &lt;div class="ltag__twitter-tweet__media--video-preview"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KVilDHvL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/tweet_video_thumb/FGBq_YRXMAknvqZ.jpg" alt="unknown tweet media content"&gt;
          &lt;img src="/assets/play-butt.svg" class="ltag__twitter-tweet__play-butt" alt="Play butt"&gt;
        &lt;/div&gt;
        &lt;div class="ltag__twitter-tweet__video"&gt;
          
            
          
        &lt;/div&gt;
      &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--hRdEq1CX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1468972181728104458/T0HW_QRJ_normal.jpg" alt="wagmism profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        wagmism
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="mentioned-user" href="https://dev.to/unicodeveloper"&gt;@unicodeveloper&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Day 2 of &lt;a href="https://twitter.com/hashtag/15DaysOfSearch"&gt;#15DaysOfSearch&lt;/a&gt;&lt;br&gt;&lt;br&gt;How to search for code or anything in all branches of a repo starting with "emchap". ✅&lt;br&gt;&lt;br&gt;Note: "emchap" could be any string or set of characters. 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      18:50 PM - 07 Dec 2021
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1468291954475732995" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1468291954475732995" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1468291954475732995" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;h3&gt;
  
  
  Day 3
&lt;/h3&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;
      &lt;div class="ltag__twitter-tweet__media ltag__twitter-tweet__media__video-wrapper"&gt;
        &lt;div class="ltag__twitter-tweet__media--video-preview"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eQvssMht--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/tweet_video_thumb/FGGqHxmXMAsUs8B.jpg" alt="unknown tweet media content"&gt;
          &lt;img src="/assets/play-butt.svg" class="ltag__twitter-tweet__play-butt" alt="Play butt"&gt;
        &lt;/div&gt;
        &lt;div class="ltag__twitter-tweet__video"&gt;
          
            
          
        &lt;/div&gt;
      &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--hRdEq1CX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1468972181728104458/T0HW_QRJ_normal.jpg" alt="wagmism profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        wagmism
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="mentioned-user" href="https://dev.to/unicodeveloper"&gt;@unicodeveloper&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Day 3 of &lt;a href="https://twitter.com/hashtag/15DaysOfSearch"&gt;#15DaysOfSearch&lt;/a&gt; 🔥 🚀&lt;br&gt;&lt;br&gt;Today, we'll perform a diff search on repos. With &lt;a href="https://twitter.com/sourcegraph"&gt;@sourcegraph&lt;/a&gt;, you can run a query like so:&lt;br&gt;&lt;br&gt;Search Query: repo:^github\.com/sourcegraph/sourcegraph$ type:diff matrix 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      18:28 PM - 08 Dec 2021
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1468648589412999172" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1468648589412999172" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1468648589412999172" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;h3&gt;
  
  
  Day 4
&lt;/h3&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;
      &lt;div class="ltag__twitter-tweet__media ltag__twitter-tweet__media__video-wrapper"&gt;
        &lt;div class="ltag__twitter-tweet__media--video-preview"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BuBH0IHL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/tweet_video_thumb/FGLID6JUUAsYsYj.jpg" alt="unknown tweet media content"&gt;
          &lt;img src="/assets/play-butt.svg" class="ltag__twitter-tweet__play-butt" alt="Play butt"&gt;
        &lt;/div&gt;
        &lt;div class="ltag__twitter-tweet__video"&gt;
          
            
          
        &lt;/div&gt;
      &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--hRdEq1CX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1468972181728104458/T0HW_QRJ_normal.jpg" alt="wagmism profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        wagmism
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="mentioned-user" href="https://dev.to/unicodeveloper"&gt;@unicodeveloper&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Day 4 of &lt;a href="https://twitter.com/hashtag/15DaysOfSearch"&gt;#15DaysOfSearch&lt;/a&gt; 😍&lt;br&gt;&lt;br&gt;Today, we’ll learn how to perform a symbol search on &lt;a href="https://twitter.com/sourcegraph"&gt;@sourcegraph&lt;/a&gt;.&lt;br&gt;&lt;br&gt;With the type:symbol filter, you can search for specific functions, classes, struct definitions &amp;amp; more in your codebase.&lt;br&gt;&lt;br&gt;Let's search for newrouter in Go codebases. 😌 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      14:52 PM - 09 Dec 2021
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1468956675818156036" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1468956675818156036" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1468956675818156036" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;h3&gt;
  
  
  Day 5
&lt;/h3&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;
      &lt;div class="ltag__twitter-tweet__media ltag__twitter-tweet__media__video-wrapper"&gt;
        &lt;div class="ltag__twitter-tweet__media--video-preview"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BuBH0IHL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/tweet_video_thumb/FGLID6JUUAsYsYj.jpg" alt="unknown tweet media content"&gt;
          &lt;img src="/assets/play-butt.svg" class="ltag__twitter-tweet__play-butt" alt="Play butt"&gt;
        &lt;/div&gt;
        &lt;div class="ltag__twitter-tweet__video"&gt;
          
            
          
        &lt;/div&gt;
      &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--hRdEq1CX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1468972181728104458/T0HW_QRJ_normal.jpg" alt="wagmism profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        wagmism
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="mentioned-user" href="https://dev.to/unicodeveloper"&gt;@unicodeveloper&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Day 4 of &lt;a href="https://twitter.com/hashtag/15DaysOfSearch"&gt;#15DaysOfSearch&lt;/a&gt; 😍&lt;br&gt;&lt;br&gt;Today, we’ll learn how to perform a symbol search on &lt;a href="https://twitter.com/sourcegraph"&gt;@sourcegraph&lt;/a&gt;.&lt;br&gt;&lt;br&gt;With the type:symbol filter, you can search for specific functions, classes, struct definitions &amp;amp; more in your codebase.&lt;br&gt;&lt;br&gt;Let's search for newrouter in Go codebases. 😌 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      14:52 PM - 09 Dec 2021
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1468956675818156036" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1468956675818156036" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1468956675818156036" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;h3&gt;
  
  
  Day 6
&lt;/h3&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;
      &lt;div class="ltag__twitter-tweet__media ltag__twitter-tweet__media__video-wrapper"&gt;
        &lt;div class="ltag__twitter-tweet__media--video-preview"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Vd17Xj_v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/tweet_video_thumb/FGmP7NSWYBI6qOE.jpg" alt="unknown tweet media content"&gt;
          &lt;img src="/assets/play-butt.svg" class="ltag__twitter-tweet__play-butt" alt="Play butt"&gt;
        &lt;/div&gt;
        &lt;div class="ltag__twitter-tweet__video"&gt;
          
            
          
        &lt;/div&gt;
      &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--hRdEq1CX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1468972181728104458/T0HW_QRJ_normal.jpg" alt="wagmism profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        wagmism
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="mentioned-user" href="https://dev.to/unicodeveloper"&gt;@unicodeveloper&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Day 6 of &lt;a href="https://twitter.com/hashtag/15DaysOfSearch"&gt;#15DaysOfSearch&lt;/a&gt; 🔥🚀&lt;br&gt;&lt;br&gt;Today, we'll look at how you can discover secrets, private keys and tokens quickly across your codebase with &lt;a href="https://twitter.com/sourcegraph"&gt;@sourcegraph&lt;/a&gt; code search.&lt;br&gt;&lt;br&gt;With a regular expression search, you can do this: 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      21:15 PM - 14 Dec 2021
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1470865101871853572" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1470865101871853572" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1470865101871853572" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;h3&gt;
  
  
  Day 7
&lt;/h3&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;
      &lt;div class="ltag__twitter-tweet__media ltag__twitter-tweet__media__video-wrapper"&gt;
        &lt;div class="ltag__twitter-tweet__media--video-preview"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4-hl0YDx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/tweet_video_thumb/FGrXwOzWQAUtIoG.jpg" alt="unknown tweet media content"&gt;
          &lt;img src="/assets/play-butt.svg" class="ltag__twitter-tweet__play-butt" alt="Play butt"&gt;
        &lt;/div&gt;
        &lt;div class="ltag__twitter-tweet__video"&gt;
          
            
          
        &lt;/div&gt;
      &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--hRdEq1CX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1468972181728104458/T0HW_QRJ_normal.jpg" alt="wagmism profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        wagmism
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="mentioned-user" href="https://dev.to/unicodeveloper"&gt;@unicodeveloper&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Day 7 of &lt;a href="https://twitter.com/hashtag/15DaysOfSearch"&gt;#15DaysOfSearch&lt;/a&gt;&lt;br&gt;&lt;br&gt;Today we'll perform a language-specific code search on &lt;a href="https://twitter.com/sourcegraph"&gt;@sourcegraph&lt;/a&gt;.&lt;br&gt;&lt;br&gt;With the "lang" keyword filter, you can narrow your search to return results for a particular language/technology. &lt;br&gt;&lt;br&gt;Let's do a wild search for "lambda" 😌😍 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      21:09 PM - 15 Dec 2021
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1471225968345980939" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1471225968345980939" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1471225968345980939" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;h3&gt;
  
  
  Day 8
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Tweet:&lt;/strong&gt;&lt;/em&gt; &lt;a href="https://twitter.com/unicodeveloper/status/1471329823117254660?s=20"&gt;How to discover projects and repos by checking if they have specific files in them using the “repo:contains.file()” filter.&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 9
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Tweet:&lt;/strong&gt;&lt;/em&gt; &lt;a href="https://twitter.com/unicodeveloper/status/1472961486754570246?s=20"&gt;How to perform structural search queries.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 10
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Tweet:&lt;/strong&gt;&lt;/em&gt; &lt;a href="https://twitter.com/unicodeveloper/status/1473505817747931136?s=20"&gt;How to limit results to display only the repos involved by using the select:repo filter.&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 11
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Tweet:&lt;/strong&gt;&lt;/em&gt; &lt;a href="https://twitter.com/unicodeveloper/status/1474126398763814915?s=20"&gt;Search contexts on Sourcegraph.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 12
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Tweet:&lt;/strong&gt;&lt;/em&gt; &lt;a href="https://twitter.com/unicodeveloper/status/1474593969099227137?s=20"&gt;How to search archived repositories.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 13
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Tweet:&lt;/strong&gt;&lt;/em&gt; &lt;a href="https://twitter.com/unicodeveloper/status/1475217958981054467?s=20"&gt;How to search forked repositories.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 14
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Tweet:&lt;/strong&gt;&lt;/em&gt; &lt;a href="https://twitter.com/unicodeveloper/status/1475599014863466497?s=20"&gt;How to perform case sensitive searches on Sourcegraph. By default, all searches are case insensitive.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 15
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Tweet:&lt;/strong&gt;&lt;/em&gt; &lt;a href="https://twitter.com/unicodeveloper/status/1475903495131865089?s=20"&gt;How to save search, export search results and proactively monitor changes to codebase via Sourcegraph code monitor.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;Sourcegraph users report an average of 30mins a day saved by using code search. The knowledge of Sourcegraph code search tips and tricks arms you with the confidence to move fast in any codebase.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://sourcegraph.com"&gt;Sourcegraph Cloud&lt;/a&gt; is not the only option to add, explore private code and use search contexts. Sourcegraph can be installed in different ways to give you advanced search features for your private code. &lt;/p&gt;

&lt;p&gt;You can run &lt;a href="https://docs.sourcegraph.com/admin/install#self-hosted"&gt;Sourcegraph locally&lt;/a&gt; or opt-in for us to set up a &lt;a href="https://docs.sourcegraph.com/admin/install/managed"&gt;managed Sourcegraph instance&lt;/a&gt; for your team. You'll be able to use a self-hosted Sourcegraph instance for free (up to 10 users).&lt;/p&gt;




&lt;p&gt;Have suggestions or questions? Leave a comment, or join our &lt;a href="https://about.sourcegraph.com/community/?utm_medium=social&amp;amp;utm_source=devto&amp;amp;utm_campaign=slacklaunch"&gt;Community Slack Space&lt;/a&gt; where our team will be happy to answer any questions you may have about Sourcegraph.&lt;/p&gt;

</description>
      <category>codesearch</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Setting up TailwindCSS 3.0 on a Laravel project</title>
      <dc:creator>Erika Heidi</dc:creator>
      <pubDate>Wed, 15 Dec 2021 15:31:43 +0000</pubDate>
      <link>https://dev.to/sourcegraph/setting-up-tailwindcss-30-on-a-laravel-project-1cb8</link>
      <guid>https://dev.to/sourcegraph/setting-up-tailwindcss-30-on-a-laravel-project-1cb8</guid>
      <description>&lt;p&gt;In the &lt;a href="https://dev.to/sourcegraph/creating-a-new-laravel-application-with-sail-and-docker-no-php-required-4c2n"&gt;first part of our series&lt;/a&gt;, we saw how to bootstrap a new Laravel application with &lt;a href="https://laravel.com/docs/8.x/sail" rel="noopener noreferrer"&gt;Sail&lt;/a&gt; and Docker. This allows you to develop a Laravel application without having to set up a PHP development environment on your system.&lt;/p&gt;

&lt;p&gt;With the base application up and running, the second part of our livestreaming series was focused on setting up a basic blog layout using TailwindCSS. In this post, you'll see a recap with all steps executed during the live session, so that you can reproduce them at your own pace.&lt;/p&gt;

&lt;p&gt;You can also watch the &lt;a href="https://www.youtube.com/watch?v=kb73FgJBY6k" rel="noopener noreferrer"&gt;video recap on YouTube&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/kb73FgJBY6k"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Preparation
&lt;/h2&gt;

&lt;p&gt;Before moving along, make sure you have followed all steps in the &lt;a href="https://dev.to/sourcegraph/creating-a-new-laravel-application-with-sail-and-docker-no-php-required-4c2n"&gt;first tutorial of the series&lt;/a&gt; in order to bootstrap your Laravel application and development environment. This will require you to have Docker, Curl, and Git installed on your system.&lt;/p&gt;

&lt;p&gt;If you haven't yet, bring your environment up with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./vendor/bin/sail up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will start up your environment and keep it running in the background. Your Laravel application should now be available at &lt;code&gt;http://localhost&lt;/code&gt;. Open this URL on your browser and you'll see a page like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuoci8k1kpbpbcr12rur7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuoci8k1kpbpbcr12rur7.png" alt="Laravel welcome page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For convenience, you may want to create an alias to execute Sail from the application's root directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ./vendor/bin/sail sail
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x sail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can run Sail like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./sail artisan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will run Artisan on the application container.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Installing and configuring TailwindCSS 3 with Laravel
&lt;/h2&gt;

&lt;p&gt;Start by installing the frontend dependencies via NPM. The &lt;code&gt;npm&lt;/code&gt; command is available as a shortcut with Laravel Sail:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./sail npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, install TailwindCSS with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./sail npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; tailwindcss postcss autoprefixer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, run the following command to generate your Tailwind configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./sail npx tailwindcss init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you'll need to tell Laravel that you want to compile Tailwind resources using Laravel Mix. Open the &lt;code&gt;webpack.mix.js&lt;/code&gt; file (located at the root of your application) and include &lt;code&gt;tailwindcss&lt;/code&gt;  as a postCss plugin. This is how your &lt;code&gt;mix.js&lt;/code&gt; definition should look like when you're finished:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;webpack.mix.js&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;mix&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;js&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;resources/js/app.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;public/js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;postCss&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;resources/css/app.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;public/css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tailwindcss&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, you should update your &lt;code&gt;tailwind.config.js&lt;/code&gt; file to include the paths to all your template resources. The following example will include all blade templates and JS files in your &lt;code&gt;resources&lt;/code&gt; folder:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;tailwind.config.js&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./resources/**/*.blade.php&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./resources/**/*.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next step is to import all &lt;code&gt;@tailwindcss&lt;/code&gt; component layers into your application's CSS. Open the &lt;code&gt;resources/css/app.css&lt;/code&gt; file and include the following content:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;resources/css/app.css&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@tailwind&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@tailwind&lt;/span&gt; &lt;span class="n"&gt;components&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@tailwind&lt;/span&gt; &lt;span class="n"&gt;utilities&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The configuration is done. You can now run the command that will watch for changes in your frontend resources and build assets in real time while you develop your application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./sail npm run watch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will block your terminal. You can stop it at any time with &lt;code&gt;CTRL&lt;/code&gt;+&lt;code&gt;C&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Creating a basic blog template
&lt;/h2&gt;

&lt;p&gt;Now that your setup is complete, you can start building the frontend of your application. For this demo, we're building a basic blog template with a main column and a sidebar on the right.&lt;/p&gt;

&lt;p&gt;A good idea to get started is to search for a &lt;a href="https://www.sitepoint.com/a-basic-html5-template/" rel="noopener noreferrer"&gt;basic HTML5 boilerplate code / template&lt;/a&gt; and build from there.&lt;/p&gt;

&lt;p&gt;After some experimentation, we built the following template during the &lt;a href="https://twitch.tv/sourcegraph" rel="noopener noreferrer"&gt;livestreaming session&lt;/a&gt;. Save this content to a file named &lt;code&gt;index.blade.php&lt;/code&gt; in your &lt;code&gt;resources/views&lt;/code&gt; folder:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;resources/views/index.blade.php&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"utf-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;My DEV Blog&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"description"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"My DEV Blog"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"author"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"Sourcegraph"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:title"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"A headless blog in Laravel"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:type"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"website"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:url"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"https://github.com/sourcegraph-community/laravel-dev-blog"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:description"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"A demo Laravel blog"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"{{ asset('css/app.css') }}"&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;body&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"bg-gradient-to-r from-blue-600 via-pink-500 to-purple-900"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container text-white mx-auto mt-6"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"grid grid-cols-3 gap-4"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-3xl"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;My DEV Blog&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"col-span-2 text-right"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                menu
            &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container mx-auto px-6 py-10 bg-gray-100 my-10 text-gray-600 rounded-md shadow-md"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"grid grid-cols-4 gap-4"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"col-span-3"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

                &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mb-10"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://picsum.photos/1000/420"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Post header image"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"rounded-lg my-4"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-3xl"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;This is the title of my first post&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

                    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is the description bnablab alba lbal ablabla blab al.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

                &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"my-10"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://picsum.photos/1000/420?sjdj"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Post header image"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"rounded-lg my-4"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-3xl"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;This is the title of my second post&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

                    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is the description bnablab alba lbal ablabla blab al.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

            &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

            &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;h2&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-gray-400 text-xl"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Categories&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;

                &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Linux&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;PHP&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Development&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Devops&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Career&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see from the code, apart from the &lt;code&gt;asset&lt;/code&gt; call, the rest is purely HTML and CSS styled with TailwindCSS descriptive classes.&lt;/p&gt;

&lt;p&gt;After saving the template, open your &lt;code&gt;routes/web.php&lt;/code&gt; file and update your main route definition so that it renders your new template instead of the default Laravel welcome page. This is how the file should look like once you're done:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;routes/web.php&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;view&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'index'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file. If you reload your browser now, you should see a page like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F54zmfaypzgtry344muso.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F54zmfaypzgtry344muso.png" alt="screenshot application with basic blog template built with tailwind css"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In a later part of this series, we'll turn this skeleton into an actual dynamic template, using more advanced Blade features.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Installing TailwindCSS 3.0 within a Laravel project requires a few configuration steps, but once you get the build command running, you can greatly speed up your frontend development process by making use of the advanced features of Tailwind 3, including just-in-time processing for super fast build times, as well as many other &lt;a href="https://tailwindcss.com/blog/tailwindcss-v3" rel="noopener noreferrer"&gt;features included in the newest version&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In the next part of this series, we'll move to the backend and create an Artisan command to import posts from a DEV user profile.&lt;/p&gt;

&lt;p&gt;You can follow &lt;a href="https://twitch.tv/sourcegraph" rel="noopener noreferrer"&gt;Sourcegraph on Twitch&lt;/a&gt; to be notified when we go live.&lt;/p&gt;

</description>
      <category>css</category>
      <category>php</category>
      <category>laravel</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to find log4j vulnerable dependencies quickly across your codebase</title>
      <dc:creator>Prosper Otemuyiwa</dc:creator>
      <pubDate>Tue, 14 Dec 2021 19:59:57 +0000</pubDate>
      <link>https://dev.to/sourcegraph/how-to-find-log4j-vulnerable-dependencies-quickly-across-your-codebase-32oj</link>
      <guid>https://dev.to/sourcegraph/how-to-find-log4j-vulnerable-dependencies-quickly-across-your-codebase-32oj</guid>
      <description>&lt;p&gt;To quickly determine which of your projects depend on the vulnerable versions of log4j, run these queries on Sourcegraph:&lt;/p&gt;

&lt;h3&gt;
  
  
  Gradle
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;org\.apache\.logging\.log4j' 2\.((0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)(\.[0-9]+))
lang:gradle patterntype:regexp count:all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Search Query:&lt;/strong&gt; &lt;a href="https://sourcegraph.com/search?q=context:global+lang:gradle+org%5C.apache%5C.logging%5C.log4j%5B%27%22%5D+2%5C.%280%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C12%7C13%7C14%7C15%29%28%5C.%5B0-9%5D%2B%29&amp;amp;patternType=regexp"&gt;Gradle&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Mavin
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;log4j\.version&amp;gt;2\.((0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)(\.[0-9]+))&amp;lt;/log4j\.version&amp;gt;
file:pom\.xml patterntype:regexp count:all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Search Query:&lt;/strong&gt; &lt;a href="https://sourcegraph.com/search?q=context:global+file:pom.xml+%3Clog4j%5C.version%3E2%5C.%280%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C12%7C13%7C14%7C15%29%28%5C.%5B0-9%5D%2B%29%3C/log4j%5C.version%3E&amp;amp;patternType=regexp"&gt;Mavin&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Ivy
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;org="org\.apache\.logging\.log4j".*rev="2\.((0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)(\.[0-9]+))"
file:ivy\.xml patterntype:regexp count:all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Search Query:&lt;/strong&gt; &lt;a href="https://sourcegraph.com/search?q=context:global+file:ivy.xml+org%3D%22org%5C.apache%5C.logging%5C.log4j%22+rev%3D%222%5C.%280%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C12%7C13%7C14%7C15%29%28%5C.%5B0-9%5D%2B%29%22&amp;amp;patternType=regexp"&gt;Ivy&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  SBT(Scala)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;org.apache.logging.log4j" % "2.((0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)(\.[0-9]+))
file:\.sbt$ patterntype:regexp count:all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Search Query:&lt;/strong&gt; &lt;a href="https://sourcegraph.com/search?q=context:global+file:%5C.sbt%24+%22org.apache.logging.log4j%22+%25+%222%5C.%280%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C12%7C13%7C14%7C15%29%28%5C.%5B0-9%5D%2B%29&amp;amp;patternType=regexp"&gt;Scala&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Bazel
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;org\.apache\.logging\.log4j: 2.((0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)(\.[0-9]+))
lang:bazel patterntype:regexp count:all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Search Query:&lt;/strong&gt; &lt;a href="https://sourcegraph.com/search?q=context:global+lang:bazel+org%5C.apache%5C.logging%5C.log4j:+2%5C.%280%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C12%7C13%7C14%7C15%29%28%5C.%5B0-9%5D%2B%29&amp;amp;patternType=regexp"&gt;Bazel&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Any file containing org.apache.logging.log4j followed by a vulnerable version number
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;org\.apache\.logging\.log4j 2.((0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)(\.[0-9]+))
patterntype:regexp count:all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Search Query:&lt;/strong&gt; &lt;a href="https://sourcegraph.com/search?q=context:global+org%5C.apache%5C.logging%5C.log4j+2%5C.%280%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C12%7C13%7C14%7C15%29%28%5C.%5B0-9%5D%2B%29&amp;amp;patternType=regexp"&gt;Any file containing org.apache.logging.log4j followed by a vulnerable version number&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Search your organization’s private code
&lt;/h3&gt;

&lt;p&gt;On &lt;a href="https://sourcegraph.com"&gt;Sourcegraph Cloud&lt;/a&gt;, run the queries linked above in your user search context &lt;strong&gt;(context:@username)&lt;/strong&gt;, after you’ve synced all of the org repositories you want to search &lt;strong&gt;(in Settings &amp;gt; Account &amp;gt; Your repositories)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;On a &lt;a href="https://docs.sourcegraph.com/?_ga=2.15375984.777352015.1639448382-1702082279.1639448382&amp;amp;_gac=1.153587914.1636895801.Cj0KCQiAhMOMBhDhARIsAPVml-GU6W22T_XZ_khgKhGR4BWZj1Bq85dwPR4AfI1Ju6PKl17Dt7qWnc0aAihpEALw_wcB#quick-install"&gt;self-hosted Sourcegraph instance&lt;/a&gt;, copy and paste those queries above into the search box on your instance. After pasting, ensure the .* (regexp search) button is on for queries that contain regular expressions.&lt;/p&gt;

&lt;h2&gt;
  
  
  In-depth Log4j 0-day fixes and mitigations
&lt;/h2&gt;

&lt;p&gt;For in-depth info on Log4j Log4Shell 0-day, check out this &lt;a href="https://about.sourcegraph.com/blog/log4j-log4shell-0-day/?utm_medium=social&amp;amp;utm_source=twitter&amp;amp;utm_campaign=blog"&gt;excellent article on finding, fixing, and track affected codebase.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Finding and fixing vulnerabilities in your codebase can be challenging, but with the right tools, you can speed up the process and secure your codebase in minimal time.&lt;/p&gt;




&lt;p&gt;Have suggestions or questions? Leave a comment, or join our &lt;a href="https://about.sourcegraph.com/community/?utm_medium=social&amp;amp;utm_source=devto&amp;amp;utm_campaign=slacklaunch"&gt;Community Slack Space&lt;/a&gt; where our team will be happy to answer any questions you may have about Sourcegraph.&lt;/p&gt;

</description>
      <category>security</category>
      <category>programming</category>
      <category>computerscience</category>
      <category>devops</category>
    </item>
    <item>
      <title>Creating a new Laravel application with Sail and Docker (no PHP setup required)</title>
      <dc:creator>Erika Heidi</dc:creator>
      <pubDate>Fri, 10 Dec 2021 13:58:03 +0000</pubDate>
      <link>https://dev.to/sourcegraph/creating-a-new-laravel-application-with-sail-and-docker-no-php-required-4c2n</link>
      <guid>https://dev.to/sourcegraph/creating-a-new-laravel-application-with-sail-and-docker-no-php-required-4c2n</guid>
      <description>&lt;p&gt;In the first episode of our livestreaming series &lt;em&gt;Getting Started with Laravel&lt;/em&gt; on &lt;a href="https://twitch.tv/sourcegraph" rel="noopener noreferrer"&gt;Sourcegraph's Twitch channel&lt;/a&gt;, we've seen how to bootstrap a new Laravel application with &lt;a href="https://laravel.com/docs/8.x/sail" rel="noopener noreferrer"&gt;Sail&lt;/a&gt; and Docker. This allows you to develop your Laravel application using Docker containers instead of having to set up a fully functional PHP development environment on a local machine or development server.&lt;/p&gt;

&lt;p&gt;In this recap post, we'll share all steps that were executed during the live session, so that you're able to reproduce them at your own pace. If you prefer, you can also watch the video version of this recap &lt;a href="https://www.youtube.com/watch?v=YH216RDiGkc" rel="noopener noreferrer"&gt;on youtube&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/YH216RDiGkc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Preparation
&lt;/h2&gt;

&lt;p&gt;Before moving along, make sure you have the following software installed and configured on your local machine or development server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;Curl&lt;/li&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Windows and MacOS users will need Docker Desktop installed. Linux users need only the Docker engine installed. Make sure you add your user to the &lt;code&gt;docker&lt;/code&gt; group so that you are able to execute Docker with your regular user.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create a new Laravel application with the official builder script
&lt;/h2&gt;

&lt;p&gt;The demo application is a blog-like application that pulls content from a user's profile at &lt;a href="https://dev.to"&gt;DEV&lt;/a&gt;. We'll call it &lt;strong&gt;laravel-dev-blog&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The next command will download the builder script from an official Laravel site and run it using &lt;code&gt;bash&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://laravel.build/laravel-dev-blog | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This operation may take a few minutes the first time you run the installer, since it will download a suitable PHP image to execute Composer and install the application dependencies using Docker.&lt;/p&gt;

&lt;p&gt;Before finishing, the installation script will ask you to confirm your &lt;code&gt;sudo&lt;/code&gt; password in order to set the correct permissions on the application directories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application ready! Build something amazing.
Sail scaffolding installed successfully.

Please provide your password so we can make some final adjustments to your application's permissions.

[sudo] password for erika: 

Thank you! We hope you build something incredible. Dive in with: cd laravel-dev-blog &amp;amp;&amp;amp; ./vendor/bin/sail up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now explore the files in your freshly installed Laravel application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;laravel-dev-blog/
&lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;artisan&lt;/code&gt; script, located at the root of the application folder, is an important tool that you can use to generate boilerplate code, manipulate the database, run jobs and queues, among other things.&lt;/p&gt;

&lt;p&gt;Following, a list with the relevant directories within a freshly installed Laravel application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.
├── app/ # models, controllers, and app-specific logic
├── bootstrap/
├── config/ # configuration files
├── database/ # database-related classes and scripts
├── public/ # the document root for the application
├── resources/ # front end resources that aren't public: views, base CSS and JS 
├── routes/ # where the application routes are defined
├── storage/ # file uploads, cache, and logs are stored here
├── tests/ #application tests

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2.  Running &lt;code&gt;sail up&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;With the files in place, you can now bring your development environment up with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sail up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will run your development environment in foreground mode, which allows you to see container logs in real time, but it will block your terminal. To stop the execution and save the state of containers, you can hit &lt;code&gt;CTRL+C&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To run the environment in background mode (detached), include &lt;code&gt;-d&lt;/code&gt; as an argument to the previous command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sail up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whether you choose to run your environment in foreground or background mode, your new Laravel application should now be available at &lt;code&gt;http://localhost&lt;/code&gt;. Open this URL on your browser and you'll see a page like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuoci8k1kpbpbcr12rur7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuoci8k1kpbpbcr12rur7.png" alt="Laravel welcome page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Sail quick reference
&lt;/h3&gt;

&lt;p&gt;The following list contains a short reference on the main Sail commands:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sail up&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Brings the Docker environment up.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sail down&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Brings the Docker environment down and remove associated containers, storage, and network.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sail start&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Starts an environment that was previously stopped with &lt;code&gt;sail stop&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sail stop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stops an environment that is currently running, saving the state of containers and services.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sail artisan&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Runs the &lt;code&gt;artisan&lt;/code&gt; tool on the application container.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sail php&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Runs a PHP script on the application container.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For more information on all available Sail commands, please visit the &lt;a href="https://laravel.com/docs/8.x/sail#executing-sail-commands" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;p&gt;Here are a few tips for troubleshooting common problems that may happen while you run this tutorial.&lt;/p&gt;

&lt;h4&gt;
  
  
  'Docker' is not running
&lt;/h4&gt;

&lt;p&gt;This error can appear if the Docker service is not enabled on your system, or if your current system user doesn't have permission to execute Docker. On new installations of the Docker engine on Linux, only the &lt;strong&gt;root&lt;/strong&gt; user is able to manage containers. You need to make sure your system user is added to the &lt;strong&gt;docker&lt;/strong&gt; group on your system.&lt;/p&gt;

&lt;h4&gt;
  
  
  I added my user to the docker group, but it still doesn't work
&lt;/h4&gt;

&lt;p&gt;After adding the user to the group, you need to restart your session so that the changes are valid. You can log out and log on again on your system. Another option is to run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;u - &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Although this is a temporary solution and you'll still need to restart your session so that the change is permanent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With the Laravel builder script and Sail, it is possible to install and run a Laravel application without the need to have PHP installed on your local machine or development server. This can be very useful to explore the Laravel framework and the PHP language in general, with the additional advantage of using a standardized development environment that is compatible and optimized for running Laravel.&lt;/p&gt;

&lt;p&gt;In the next part of this series, we'll start building the front end of our project using TailwindCSS.&lt;/p&gt;

&lt;p&gt;Follow &lt;a href="https://twitch.tv/sourcegraph]" rel="noopener noreferrer"&gt;Sourcegraph on Twitch&lt;/a&gt; to be notified when we go live with new episodes on this series.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>php</category>
      <category>laravel</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to use Search Contexts on Sourcegraph</title>
      <dc:creator>Prosper Otemuyiwa</dc:creator>
      <pubDate>Fri, 19 Nov 2021 12:02:50 +0000</pubDate>
      <link>https://dev.to/sourcegraph/how-to-use-search-contexts-on-sourcegraph-138n</link>
      <guid>https://dev.to/sourcegraph/how-to-use-search-contexts-on-sourcegraph-138n</guid>
      <description>&lt;p&gt;Sourcegraph prides itself in the ability to search millions of open source and private repositories. &lt;/p&gt;

&lt;p&gt;Many features enrich the developer's experience of using Sourcegraph code search. One of such features is &lt;strong&gt;Search Contexts&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In this article, you'll learn how to use search contexts on &lt;a href="https://sourcegraph.com" rel="noopener noreferrer"&gt;Sourcegraph Cloud&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What are Search Contexts?
&lt;/h2&gt;

&lt;p&gt;Search contexts are a set of repositories at specific revisions that search queries on Sourcegraph will target. In other words, search contexts enable you to narrow, group and search only the code repositories you care about. &lt;/p&gt;

&lt;p&gt;By default, Sourcegraph uses a global search context (namely, &lt;code&gt;context:global&lt;/code&gt;) for all search queries, when no search context is specified by the actor (me, you, or a programmable robot) performing the search.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use cases for Search Contexts
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;First&lt;/em&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;In a day, I search many repositories for code. I have identified about 15 code repos that often come up repeatedly and return the desired search results. I want to group them so that my search query targets only this set of repos.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Second&lt;/em&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sequel to the first case, Sourcegraph allows me to search code repo branches. Instead of specifying the branch names in my query every time, I want to group specific branches of certain repos once to focus more on what I need to find than the semantics of finding it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Third&lt;/em&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;My company has hundreds of repos, thousands of developers and several teams. Sourcegraph allows us to search all of these repos. However, we'd also like each team to be able to search only the code repos they actively manage.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to use Search Contexts
&lt;/h2&gt;

&lt;p&gt;The first step is to go to &lt;a href="https://sourcegraph.com" rel="noopener noreferrer"&gt;sourcegraph.com&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;You’ll see a &lt;strong&gt;context:global&lt;/strong&gt; selector at the left side of the search textbox. &lt;/p&gt;

&lt;p&gt;Every open-source repository that is added to &lt;a href="https://sourcegraph.com" rel="noopener noreferrer"&gt;Sourcegraph Cloud&lt;/a&gt; is automatically assigned to the global search context.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9zybq8h07ny2fjsicpuj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9zybq8h07ny2fjsicpuj.png" alt="Global context"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can explore other available public search contexts by clicking the search contexts selector. A dropdown menu should appear as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9r5c2yb0d9grwnaumav.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9r5c2yb0d9grwnaumav.png" alt="Dropdown of other contexts"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yaaaay!! More public search contexts. Here we have: &lt;a href="https://sourcegraph.com/contexts/chakraui" rel="noopener noreferrer"&gt;chakraui&lt;/a&gt;, &lt;a href="https://sourcegraph.com/contexts/cncf" rel="noopener noreferrer"&gt;cncf&lt;/a&gt;, &lt;a href="https://sourcegraph.com/contexts/kubernetes" rel="noopener noreferrer"&gt;kubernetes&lt;/a&gt;, &lt;a href="https://sourcegraph.com/contexts/o3de" rel="noopener noreferrer"&gt;o3de&lt;/a&gt;, &lt;a href="https://sourcegraph.com/contexts/stackstorm" rel="noopener noreferrer"&gt;stackstorm&lt;/a&gt;, &lt;a href="https://sourcegraph.com/contexts/stanford" rel="noopener noreferrer"&gt;stanford&lt;/a&gt;, and &lt;a href="https://sourcegraph.com/contexts/temporalio" rel="noopener noreferrer"&gt;temporalio&lt;/a&gt; search contexts that anyone can use to explore public code.&lt;/p&gt;

&lt;p&gt;Given a scenario where you want to search for code within the Kubernetes community, you can select the &lt;strong&gt;kubernetes&lt;/strong&gt; search context and input your query syntax in the search textbox like so:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Filj7biikt1klj43rqofu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Filj7biikt1klj43rqofu.png" alt="Public search contexts"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It only searches for code within the &lt;strong&gt;Kubernetes&lt;/strong&gt; search context. One major benefit of search contexts is the swift response time you get while searching for anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Recommendation:&lt;/strong&gt; Explore the Stanford search context. A treasure of open source code from Stanford students, academics and professors!&lt;/p&gt;

&lt;p&gt;You’re probably wondering how to create your search context. So let’s get into it!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; By the way, if you have added repositories to &lt;a href="https://sourcegraph.com" rel="noopener noreferrer"&gt;Sourcegraph Cloud&lt;/a&gt;, you already have a search context in this format: &lt;strong&gt;context:@username&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to create Search Contexts
&lt;/h2&gt;

&lt;p&gt;Follow these steps:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1
&lt;/h3&gt;

&lt;p&gt;Sign up for a free account on &lt;a href="https://sourcegraph.com/sign-up" rel="noopener noreferrer"&gt;Sourcegraph.com&lt;/a&gt;. You can’t create a search context without an account.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2
&lt;/h3&gt;

&lt;p&gt;Go to &lt;em&gt;Code Search&lt;/em&gt; in the top left navigation bar. On Hover, you’ll see a dropdown.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F36vptwehge9jkbkrgr49.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F36vptwehge9jkbkrgr49.png" alt="Search Context drop down"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the &lt;em&gt;Contexts&lt;/em&gt; menu item. It'll direct you to a page that shows all your existing search contexts (if you have others apart from the global search context).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9n3plwxy4ef7w4jtb7lw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9n3plwxy4ef7w4jtb7lw.png" alt="All search contexts"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the image above, you can see that I already have a &lt;strong&gt;context:&lt;a class="mentioned-user" href="https://dev.to/unicodeveloper"&gt;@unicodeveloper&lt;/a&gt;&lt;/strong&gt; search context because I added some private repositories to Sourcegraph a few months ago.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3
&lt;/h3&gt;

&lt;p&gt;Click on the &lt;em&gt;Create search context&lt;/em&gt; button by the right hand side.&lt;br&gt;
It will direct you to &lt;a href="https://sourcegraph.com/contexts/new" rel="noopener noreferrer"&gt;https://sourcegraph.com/contexts/new&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foipbdue52pum25dh64j9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foipbdue52pum25dh64j9.png" alt="Create new search context"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add a &lt;strong&gt;name&lt;/strong&gt; and &lt;strong&gt;description&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Choose the &lt;strong&gt;visibility&lt;/strong&gt; of the context.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F64o7x5t2frrbgghnue87.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F64o7x5t2frrbgghnue87.png" alt="Context visibility"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, add the repositories you want to be part of this context in the format above.&lt;/p&gt;

&lt;p&gt;An example is this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fflklkrbkoj1wh4lugutr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fflklkrbkoj1wh4lugutr.png" alt="Add repository to the context"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Remove the “https://” when adding the repository URL. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test the configuration&lt;/li&gt;
&lt;li&gt;Go ahead and create the search context.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You will see your recently created search context. Mine is below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvsly935o1pryw2pcly7s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvsly935o1pryw2pcly7s.png" alt="Eden life backend context"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F51un79afcpyndft1kma7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F51un79afcpyndft1kma7.png" alt="All contexts"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, you can explore only the code you care about in this newly minted search context like so:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fagbznm50vsx5ijo8sd3k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fagbznm50vsx5ijo8sd3k.png" alt="Explore new search context"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Don’t forget to press the context selector to switch to the global search context if you need to explore all the public code on Sourcegraph.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As developers, our knowledge of refactoring code and identifying patterns come in handy in automating repeatable processes. Leverage your search context knowledge in taking your code search prowess to the next level.&lt;/p&gt;

&lt;p&gt;Create as many contexts as possible to match your use case. If you are part of a team, invite them to enjoy the benefits of code search.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sourcegraph.com" rel="noopener noreferrer"&gt;Sourcegraph.com&lt;/a&gt; is not the only option to &lt;a href="https://learn.sourcegraph.com/how-to-add-private-code-repositories-to-sourcegraph" rel="noopener noreferrer"&gt;add, explore private code&lt;/a&gt; and use search contexts. Sourcegraph can be installed in different ways to set up a deployment for your private code. &lt;/p&gt;

&lt;p&gt;You can run &lt;a href="https://docs.sourcegraph.com/admin/install#self-hosted" rel="noopener noreferrer"&gt;Sourcegraph locally&lt;/a&gt; or opt-in for us to set up a &lt;a href="https://docs.sourcegraph.com/admin/install/managed" rel="noopener noreferrer"&gt;managed Sourcegraph instance&lt;/a&gt; for your team. You'll be able to use a self-hosted Sourcegraph instance for free (up to 10-users).&lt;/p&gt;




&lt;p&gt;Have suggestions or questions? Leave a comment, or join our &lt;a href="https://about.sourcegraph.com/community/?utm_medium=social&amp;amp;utm_source=devto&amp;amp;utm_campaign=slacklaunch" rel="noopener noreferrer"&gt;Community Slack Space&lt;/a&gt; where our team will be happy to answer any questions you may have about Sourcegraph.&lt;/p&gt;

</description>
      <category>codesearch</category>
      <category>sourcegraph</category>
      <category>search</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
