<?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: sahilthakare</title>
    <description>The latest articles on DEV Community by sahilthakare (@sahilthakare1998).</description>
    <link>https://dev.to/sahilthakare1998</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%2F609285%2Ff27c3527-cb8e-468a-a650-dd40fea0fa56.png</url>
      <title>DEV Community: sahilthakare</title>
      <link>https://dev.to/sahilthakare1998</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sahilthakare1998"/>
    <language>en</language>
    <item>
      <title>Unmerging a git branch, keeping post-merge commits</title>
      <dc:creator>sahilthakare</dc:creator>
      <pubDate>Thu, 08 Apr 2021 14:39:24 +0000</pubDate>
      <link>https://dev.to/sahilthakare1998/unmerging-a-git-branch-keeping-post-merge-commits-4aad</link>
      <guid>https://dev.to/sahilthakare1998/unmerging-a-git-branch-keeping-post-merge-commits-4aad</guid>
      <description>&lt;h4&gt;
  
  
  push your code Everyday to git?
&lt;/h4&gt;

&lt;p&gt;After several commits on the merged master, the client wants the work done on the commit removed, but not the commits done after the merge.&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%2Fbqkisad8nm82mlh3rb3y.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%2Fbqkisad8nm82mlh3rb3y.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Say there are &lt;strong&gt;three&lt;/strong&gt; branches master, branch-A and branch-B.&lt;/p&gt;

&lt;p&gt;I work on branch-A, a friend on branch-B. Once things are finalized, we merge branch-A and branch-B with the master.&lt;/p&gt;

&lt;p&gt;After several commits on the merged master, the client wants the work done on branch-B removed, but NOT the commits done By branch-A after the merge.&lt;/p&gt;
&lt;h3&gt;
  
  
  How can we do it?
&lt;/h3&gt;
&lt;h4&gt;
  
  
  Basically, you git unmerge the commits :
&lt;/h4&gt;

&lt;p&gt;Checkout to the master branch&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;View the commit history&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log
&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;$ git log
commit ca82a6dff817ec66f44342007202690a93763949
Author: Sahil &amp;lt;sahil@gee-mail.com&amp;gt;
Date:   Mon Mar 17 21:52:11 2021 -0700

    Commit by Branch-A

commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7
Author: Sahil &amp;lt;sahil@gee-mail.com&amp;gt;
Date:   Sat Mar 15 16:40:33 2021 -0700

    Commit by Brach-B

commit a11bef06a3f659402fe7563abf99ad00de2209e6
Author: Sahil &amp;lt;sahil@gee-mail.com&amp;gt;
Date:   Sat Mar 15 10:31:28 2021 -0700

    Initial commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The commit we need to unmerge is &lt;br&gt;
&lt;strong&gt;commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git revert &amp;lt;hashOfMergeCommit&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in our case&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git revert 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you need to reference numerous commits in the revert command, eg:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git revert &amp;lt;hashOfMergeCommit1&amp;gt; &amp;lt;hashOfMergeCommit2&amp;gt; &amp;lt;hashOfMergeCommit3&amp;gt;...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Congratulations!
&lt;/h3&gt;

&lt;p&gt;You've segregated the code you need, but don't stop there. Continue exploring and see what you can commit.&lt;/p&gt;

</description>
      <category>git</category>
      <category>unmerge</category>
      <category>commit</category>
    </item>
    <item>
      <title>React Maps without Google Api key or Javascript</title>
      <dc:creator>sahilthakare</dc:creator>
      <pubDate>Tue, 06 Apr 2021 11:42:03 +0000</pubDate>
      <link>https://dev.to/sahilthakare1998/react-maps-without-use-of-google-key-or-javascript-2a69</link>
      <guid>https://dev.to/sahilthakare1998/react-maps-without-use-of-google-key-or-javascript-2a69</guid>
      <description>&lt;p&gt;You’re a developer that recently landed on the React ecosystem. There’s &lt;strong&gt;so much going on&lt;/strong&gt; that you have no idea where to start.&lt;br&gt;
&lt;strong&gt;tried React-maps? Why isn’t it working?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One thing that I found is that being part of the ecosystem is the quickest way to understand it. &lt;br&gt;
We’ll be using &lt;strong&gt;npm&lt;/strong&gt; and &lt;strong&gt;Mapbox&lt;/strong&gt; to ship compact and idiomatic React code.&lt;/p&gt;
&lt;h4&gt;
  
  
  What is Mapbox?
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://elements-x.com/component/mapbox" rel="noopener noreferrer"&gt;Mapbox&lt;/a&gt; GL JS is a JavaScript library that uses WebGL to render interactive maps from &lt;a href="https://docs.mapbox.com/help/glossary/vector-tiles/" rel="noopener noreferrer"&gt;vector tiles&lt;/a&gt; and &lt;a href="https://docs.mapbox.com/mapbox-gl-js/style-spec/" rel="noopener noreferrer"&gt;Mapbox styles&lt;/a&gt;. It is part of the Mapbox GL ecosystem.&lt;/p&gt;

&lt;p&gt;Mapbox uses access tokens to associate API requests with your account. This token will prevent the abusive use of the map.&lt;/p&gt;
&lt;h4&gt;
  
  
  Add the Mapbox GL JS module
&lt;/h4&gt;

&lt;p&gt;The instructions below assume you are compiling your JS with Webpack, Browserify, or another module bundler.&lt;/p&gt;
&lt;h4&gt;
  
  
  1.Install the npm package
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install mapbox-gl --save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  Include the GL JS CSS file
&lt;/h4&gt;

&lt;p&gt;Include the GL JS CSS file in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; of your HTML file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;link href='https://api.mapbox.com/mapbox-gl-js/v2.1.1/mapbox-gl.css' rel='stylesheet' /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2.Import XMapbox
&lt;/h4&gt;

&lt;p&gt;You can get an access token from &lt;a href="https://www.mapbox.com/" rel="noopener noreferrer"&gt;Mapbox&lt;/a&gt; after creating an account. Mapbox is free unless you have high traffic to your map (more than 50,000 requests per month).&lt;br&gt;
An access token can be provided to  as an attribute: &lt;strong&gt;access-token&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { XMapbox } from "elements-x/dist/mapbox";
XMapbox.accessToken =
  "pk.eyJ1Ijoic2FoaWx0aGFrYXJlNTIxIiwiYSI6ImNrbjVvMTkzNDA2MXQydnM2OHJ6aHJvbXEifQ.z5aEqRBTtDMWoxVzf3aGsg";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  What’s &lt;code&gt;&amp;lt;x-mapbox&amp;gt;&lt;/code&gt;?
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;x-mapbox&amp;gt;&lt;/code&gt; is one of the custom elements from &lt;a href="https://elements-x.com/" rel="noopener noreferrer"&gt;Elements-X&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Display Map With a Marker
&lt;/h4&gt;

&lt;p&gt;By adding &lt;code&gt;&amp;lt;x-marker&amp;gt;&lt;/code&gt; in &lt;code&gt;&amp;lt;x-mapbox&amp;gt;&lt;/code&gt; and Built-in geocoding by providing an address or longitude and latitude.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;app.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      &amp;lt;x-div&amp;gt;
        &amp;lt;x-mapbox&amp;gt;
          &amp;lt;x-marker id="marker" lnglat="Toronto, Canada" center&amp;gt;
            Looking For Here?
          &amp;lt;/x-marker&amp;gt;
        &amp;lt;/x-mapbox&amp;gt;
      &amp;lt;/x-div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can see a map:&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%2Fo6sbwqv2idg4j2lcx0yz.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%2Fo6sbwqv2idg4j2lcx0yz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By default, map displays in terrain mode, but you can switch to satellite mode by clicking an icon in the top-right corner.&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%2Fzjrm4i9bk92a24jq885u.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%2Fzjrm4i9bk92a24jq885u.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Help yourself with the source code- &lt;a href="https://stackblitz.com/edit/react-1gnfxe?file=src/App.js" rel="noopener noreferrer"&gt;stackblitz&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Congratulations!
&lt;/h3&gt;

&lt;p&gt;You've installed Mapbox GL JS, but don't stop there. Continue exploring and see what you can build.&lt;/p&gt;

</description>
      <category>react</category>
      <category>reactmaps</category>
      <category>elementsx</category>
      <category>apikey</category>
    </item>
  </channel>
</rss>
