<?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: Aissaoui Ahmed</title>
    <description>The latest articles on DEV Community by Aissaoui Ahmed (@aissaoui_ahmed).</description>
    <link>https://dev.to/aissaoui_ahmed</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%2F92858%2Fbfeffacb-90ee-4fbc-886a-f9c0b16a8e42.jpeg</url>
      <title>DEV Community: Aissaoui Ahmed</title>
      <link>https://dev.to/aissaoui_ahmed</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aissaoui_ahmed"/>
    <language>en</language>
    <item>
      <title>Simplify Your .gitignore Generation with Git Aliases</title>
      <dc:creator>Aissaoui Ahmed</dc:creator>
      <pubDate>Wed, 26 Jul 2023 11:07:08 +0000</pubDate>
      <link>https://dev.to/aissaoui_ahmed/simplify-your-gitignore-generation-with-git-aliases-2f3f</link>
      <guid>https://dev.to/aissaoui_ahmed/simplify-your-gitignore-generation-with-git-aliases-2f3f</guid>
      <description>&lt;p&gt;Hey fellow developers,&lt;/p&gt;

&lt;p&gt;Today, I want to share with you a nifty Git alias I created that simplifies the process of generating a .gitignore file for your projects. If you often find yourself manually searching for the right .gitignore template for different programming languages, this alias will save you time and effort.&lt;/p&gt;

&lt;p&gt;The alias leverages a small shell script, which I've placed in the "~/.gitScripts" directory, aptly named "ignore.sh". This script takes a single argument - the name of the programming language you want to generate the .gitignore file for.&lt;/p&gt;

&lt;p&gt;Here's what the script looks like:&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="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="nv"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;##+([[&lt;/span&gt;:space:]]&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'Please add a programming language'&lt;/span&gt;
&lt;span class="k"&gt;fi

&lt;/span&gt;&lt;span class="nv"&gt;langUpperCase&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$lang&lt;/span&gt; | &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="s1"&gt;'s/./\u&amp;amp;/'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;

curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s2"&gt;"https://raw.githubusercontent.com/github/gitignore/main/&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;langUpperCase&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.gitignore"&lt;/span&gt; &lt;span class="nt"&gt;--output&lt;/span&gt; .gitignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's break down what the script does:&lt;/p&gt;

&lt;p&gt;It checks whether an argument (programming language) has been provided. If not, it displays a friendly message prompting you to add a programming language.&lt;br&gt;
It converts the first letter of the provided language to uppercase, as that's how GitHub organizes their .gitignore templates.&lt;br&gt;
It uses curl to download the appropriate .gitignore template from GitHub's official repository for gitignore files, based on the given programming language.&lt;br&gt;
With this script in place, you can easily generate a .gitignore file for your project by simply running the ignore alias, followed by the name of the programming language you're using. No need to hunt down the right template manually!&lt;/p&gt;

&lt;p&gt;To set up the alias, just add the following lines to your ".gitconfig" file:&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="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
    ignore &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"!sh ~/.gitScripts/ignore.sh"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you can use the git ignore command to generate the .gitignore file quickly. Here's an example of how you can use it:&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="nv"&gt;$&amp;gt;&lt;/span&gt; git ignore python
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will fetch the appropriate Python .gitignore template and create a .gitignore file in your project directory.&lt;/p&gt;

&lt;p&gt;I hope you find this Git alias as useful as I do. Happy coding and may your version control journey be smooth and efficient! 🚀&lt;/p&gt;

&lt;p&gt;Feel free to share any other Git aliases or productivity tips that you find helpful in your development workflow. Let's make coding even more enjoyable and productive together! 😊&lt;/p&gt;

&lt;p&gt;"Computers are fast, programmers keep it slow."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/pulse/simplify-your-gitignore-generation-git-aliases-aissaoui-ahmed%3FtrackingId=kfVSFIyOTcK4dJ1mjzBBSg%253D%253D/?trackingId=kfVSFIyOTcK4dJ1mjzBBSg%3D%3D"&gt;Linkedin&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>tutorial</category>
      <category>git</category>
      <category>bash</category>
    </item>
    <item>
      <title>GitHub Users</title>
      <dc:creator>Aissaoui Ahmed</dc:creator>
      <pubDate>Wed, 16 Sep 2020 21:11:43 +0000</pubDate>
      <link>https://dev.to/aissaoui_ahmed/github-users-4ko9</link>
      <guid>https://dev.to/aissaoui_ahmed/github-users-4ko9</guid>
      <description>&lt;h3&gt;
  
  
  My Workflow
&lt;/h3&gt;

&lt;p&gt;an automatic search system to get GitHub users by location&lt;/p&gt;

&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;data analytics and statistics  &lt;/p&gt;

&lt;h3&gt;
  
  
  Yaml File or Link to Code
&lt;/h3&gt;

&lt;p&gt;GitHub Repo &lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Aissaoui-Ahmed" rel="noopener noreferrer"&gt;
        Aissaoui-Ahmed
      &lt;/a&gt; / &lt;a href="https://github.com/Aissaoui-Ahmed/github-users" rel="noopener noreferrer"&gt;
        github-users
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      This repository present statistics about users on GitHub by location and search by countries and states is hole world
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;GITHUB USERS STATISTICS&lt;/h1&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Why this repository&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;This repository to get statistics about Github users around the world&lt;/p&gt;
&lt;p&gt;the users can found by location, use a search query.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Requirements&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;NodeJS
npm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Install&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;1- clone repository &lt;code&gt;git clone --depth=1 git@github.com:Aissaoui-Ahmed/github-users.git &amp;amp;&amp;amp; cd github-users&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;2- run &lt;code&gt;npm install&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;3- run &lt;code&gt;npm data&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;4- run command&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;On windows: &lt;code&gt;SET GITHUB_TOKEN=[GITHUB TOKEN] &amp;amp;&amp;amp; npm start&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On Linux: &lt;code&gt;GITHUB_TOKEN=[GITHUB TOKEN] npm start&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Contributing&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Read file &lt;a href="https://github.com/Aissaoui-Ahmed/github-users/blob/master/CONTRIBUTING.md" rel="noopener noreferrer"&gt;Contributions&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;License&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://github.com/Aissaoui-Ahmed/github-users/blob/master/LICENSE" rel="noopener noreferrer"&gt;MIT&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Aissaoui-Ahmed/github-users" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>actionshackathon</category>
      <category>github</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
