<?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: pixiebrix</title>
    <description>The latest articles on DEV Community by pixiebrix (@pixiebrix).</description>
    <link>https://dev.to/pixiebrix</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%2Fuser%2Fprofile_image%2F898358%2Fb7e70114-bb40-4db1-b2ae-9162c3728d2f.jpg</url>
      <title>DEV Community: pixiebrix</title>
      <link>https://dev.to/pixiebrix</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pixiebrix"/>
    <language>en</language>
    <item>
      <title>Disable a direct push to GitHub main branch</title>
      <dc:creator>pixiebrix</dc:creator>
      <pubDate>Wed, 03 Aug 2022 08:21:00 +0000</pubDate>
      <link>https://dev.to/pixiebrix/disable-a-direct-push-to-github-main-branch-8c2</link>
      <guid>https://dev.to/pixiebrix/disable-a-direct-push-to-github-main-branch-8c2</guid>
      <description>&lt;p&gt;On a development team, you never want to push directly to the main branch. Instead, you want to require changes to be made through pull requests so they can be properly reviewed by other developers.&lt;br&gt;
Some developers, including myself, occasionally forget to stuff their changes into a branch so I like to have an automated check to prevent this mistake. Here are two methods to block direct pushes to the GitHub main branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-commit hook
&lt;/h2&gt;

&lt;p&gt;The pre-commit framework includes a &lt;code&gt;no-commit-to-branch&lt;/code&gt; hook which blocks direct commits to specific branches. By default, it blocks the &lt;code&gt;master&lt;/code&gt; and &lt;code&gt;main&lt;/code&gt; branches.&lt;br&gt;
You can implement this by adding the following &lt;code&gt;.pre-commit-config.yaml&lt;/code&gt; file to the repository root:&lt;/p&gt;

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

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.1.0
    hooks:
      - id: no-commit-to-branch


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

&lt;/div&gt;

&lt;p&gt;Then run &lt;code&gt;pre-commit install&lt;/code&gt;. Now commits to &lt;code&gt;main&lt;/code&gt; will result in an error:&lt;/p&gt;

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

$ git commit -m "Update again"
don't commit to branch...................................................Failed
- hook id: no-commit-to-branch
- exit code: 1


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

&lt;/div&gt;

&lt;p&gt;Note, you can work around this check by uninstalling the pre-commit hook so it’s not foolproof.&lt;/p&gt;

&lt;h2&gt;
  
  
  Branch protection rule
&lt;/h2&gt;

&lt;p&gt;GitHub has branch protection rules which allow you to enforce workflows for a one or more branches.&lt;br&gt;
To create a branch protection rule, navigate to your repository’s settings. Click Branches and then Add rule under the “Branch protection rules” section.&lt;/p&gt;

&lt;p&gt;Enter “main” under &lt;strong&gt;Branch name pattern&lt;/strong&gt;. Then check &lt;strong&gt;Require a pull request before merging&lt;/strong&gt;.&lt;br&gt;
You’ll notice some additional features pop up. I generally check Require approvals so developers can’t sneak a change through without a proper sign-off.&lt;/p&gt;

&lt;p&gt;Lastly, you may want to check &lt;strong&gt;Include administrators&lt;/strong&gt; so the rule applies to repository admins. Keep in mind, however, that some git tools, such as Flux, need this access or they won’t work. So be cognizant of the tools you’re using and the privileges they need.&lt;/p&gt;

&lt;p&gt;When you’re done, your rule should look like this:&lt;br&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%2F1fojfx6rielfxiyhn3iq.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%2F1fojfx6rielfxiyhn3iq.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now direct pushes to &lt;code&gt;main&lt;/code&gt; will result in an error:&lt;/p&gt;

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

$ git push
...
remote: error: GH006: Protected branch update failed for refs/heads/main.
remote: error: Changes must be made through a pull request.
To github.com:johnnymetz/my-repo.git
 ! [remote rejected] main -&amp;gt; main (protected branch hook declined)
error: failed to push some refs to 'github.com:johnnymetz/my-repo.git'


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

&lt;/div&gt;

&lt;p&gt;I prefer the second method because it’s foolproof and includes additional features.&lt;/p&gt;

</description>
      <category>github</category>
    </item>
    <item>
      <title>Our crafty nocode extension platform</title>
      <dc:creator>pixiebrix</dc:creator>
      <pubDate>Tue, 26 Jul 2022 14:11:00 +0000</pubDate>
      <link>https://dev.to/pixiebrix/nocode-on-linkedin-3an0</link>
      <guid>https://dev.to/pixiebrix/nocode-on-linkedin-3an0</guid>
      <description>&lt;p&gt;If you're reading this blog post you might be wondering - what does PixieBrix truly do?&lt;/p&gt;

&lt;p&gt;PixieBrix lets you customize and automate the websites and apps that you use in your browser so they work for you, not the other way around.&lt;br&gt;
Let me show you how you can use this with a concrete example&lt;/p&gt;
&lt;h2&gt;
  
  
  Nocode Google Chrome Extension on Linkedin
&lt;/h2&gt;

&lt;p&gt;Have you ever wanted to do two things at once, to increase your productivity? &lt;/p&gt;

&lt;p&gt;With a little work it's possible to augment a website to do more than just showing you some data and images.&lt;/p&gt;

&lt;p&gt;If this was 2012 I would tell you "Think in widgets terms..."&lt;/p&gt;

&lt;p&gt;With PixieBrix you can customize any website and make them do new things: perhaps you can surface search engine results that mention a company while browsing LinkedIn, Crunchbase, or some other site? &lt;/p&gt;

&lt;p&gt;Maybe you're doing background research on a company &lt;strong&gt;that wants to hire you&lt;/strong&gt;, or maybe you're curious about the general &lt;/p&gt;

&lt;p&gt;This can help especially if you are browsing through hundreds of companies, whether for fun, investment research, or any other reason.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to get started
&lt;/h2&gt;

&lt;p&gt;With PixieBrix you can build a custom sidebar extension that automates searches and organizes data for you.&lt;br&gt;
In fact, we created a simple Journalist Sidebar that searches for Computerworld articles related to any company you are viewing on LinkedIn. It then lists the search results in the sidebar for easy access.&lt;/p&gt;

&lt;p&gt;What to try it out? Simply follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://app.pixiebrix.com/login/?ref=devto"&gt;Install PixieBrix&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Activate this extension: &lt;a href="https://www.pixiebrix.com/marketplace/f6aa7a5c-4a52-441f-a027-13df49d0fcb0/journalist-sidebar/?ref=devto"&gt;click here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Go to any LinkedIn company page and click the PixieBrix icon in your extension list: &lt;a href="https://www.linkedin.com/company/pixiebrix/"&gt;click here&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Watch the video ⚡️
&lt;/h2&gt;


&lt;div&gt;
  &lt;iframe src="https://loom.com/embed/9da5764936d44443a479d9b38f211b85"&gt;
  &lt;/iframe&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Why use PixieBrix
&lt;/h2&gt;

&lt;p&gt;There are many tools that are used in your day-to-day that could do with a little customization. Platforms like Google Drive, Salesforce, Greenhouse, Slack, Zoom, Hubspot, etc. are some of the most used apps by workforces worldwide, but they're disconnected which can lead to inefficiency. Sometimes it takes too much manual work to get simple things done, things that should be automated.&lt;/p&gt;

&lt;p&gt;With PixieBrix you can augment any website with any data you have available, create automations, personalize the look and feel of the tools you use so they work for you - and not the other way around. &lt;/p&gt;

&lt;p&gt;The best part is you can do ALL of this, without having to write any JavaScript, or any other programming language. (That being said you need to be slightly technical and understand some basic tech concepts like HTTP request, CSS selectors etc.)&lt;/p&gt;

&lt;p&gt;Once you master the PixieBrix kung-fu, however, you will be able to create incredible extensions for any workflow you might encounter while using your favorite websites or web apps.&lt;/p&gt;

</description>
      <category>nocode</category>
      <category>google</category>
      <category>chrome</category>
    </item>
  </channel>
</rss>
