<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mumtaz on Medium]]></title>
        <description><![CDATA[Stories by Mumtaz on Medium]]></description>
        <link>https://medium.com/@mumzee?source=rss-f25a334de851------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fRhEWzYqdbu6_uTxs7kWpA.jpeg</url>
            <title>Stories by Mumtaz on Medium</title>
            <link>https://medium.com/@mumzee?source=rss-f25a334de851------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 00:33:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mumzee/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Basic git tutorial for beginners]]></title>
            <link>https://mumzee.medium.com/list-of-basic-git-commands-1408989cf212?source=rss-f25a334de851------2</link>
            <guid isPermaLink="false">https://medium.com/p/1408989cf212</guid>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Mumtaz]]></dc:creator>
            <pubDate>Wed, 26 Oct 2022 02:38:57 GMT</pubDate>
            <atom:updated>2022-10-26T05:10:53.982Z</atom:updated>
            <content:encoded><![CDATA[<p>This post lists the git commands that a developer uses almost daily</p><h4>Terminology</h4><p><strong>origin</strong> — This is a shorthand for the remote repository. If it’s a cloned repo then that original repository’s URL is called the <strong><em>origin</em></strong>. It always refers to the remote host. This is a standard and conventional name but it can be renamed to anything else.</p><p>It is possible to have multiple <strong><em>origins</em></strong>, therefore it becomes important to specify which remote you intend to pull the code from or push the code to. For e.g. you can have an <strong><em>origin</em></strong> where code changes are regularly pushed and another one for production releases.</p><p><strong>staging area — </strong>This is like a rough draft space, it’s where you add file(s) that you want to save in your next commit. You can take files out of the staging area too, then these files will not be part of the commit.</p><p><strong>master — </strong>The default branch name in Git is <strong><em>master</em></strong> when you create a new repo.</p><h4>get the name of the remote</h4><p>git remote -v → mostly it is going to be <strong><em>origin</em></strong></p><h4>rename “<em>origin”</em></h4><p>git remote rename origin &lt;new_origin_name&gt;</p><h4>create a new repository</h4><p>git init</p><p>This creates a default branch named master</p><h4>clone a remote repository</h4><p>git clone &lt;git remote URL&gt;</p><p>e.g</p><p>git clone https://www.example.git</p><h4>create a new local branch</h4><p>git checkout -b &lt;branch_name&gt;</p><h4>switch to an existing branch on local</h4><p>git checkout &lt;branch_name&gt;</p><h4>list files to add, commit to staging area</h4><p>git status</p><h4>preview changes before merging</h4><p>git diff</p><p>git diff &lt;file&gt;</p><p>git diff &lt;source_branch&gt; &lt;target_branch&gt;</p><h4>list all the branches in the repo</h4><p>git branch</p><h4>add modified file to staging area</h4><p>git add &lt;file&gt;</p><p>To add all the modified files in current directory use:</p><p>git add .</p><p>or, to add everything at once</p><p>git add -A</p><h4>delete files from remote and filesystem</h4><p>One way is to right click file → delete then execute git add &lt;file&gt;</p><p>or</p><p>git rm &lt;file&gt;</p><h4>remove files from staging area</h4><p>git restore --staged . → This preserves the changes that you made but takes the file out of staging area</p><h4>discard your local changes</h4><p>git restore &lt;file&gt; → discard changes in the &lt;file&gt;</p><p>git restore . → discard all files</p><p>git checkout &lt;branch_name&gt; &lt;file&gt; → discard your local changes and add changes from another branch</p><p>e.g. if I have conflicts in a file and I just want to discard my changes and have what is available in master branch</p><p>git checkout master &lt;file&gt;</p><p>to drop all your local changes and commits, fetch the latest history from the server and point your local master branch at it, do this:</p><p>git fetch origin<br>git reset --hard master</p><h4>merge changes from another branch to your current working branch</h4><p>git merge &lt;another_branch&gt;</p><p>This will merge local changes of &lt;another_branch&gt; with your current branch. If there are changes on remote but are absent in you local &lt;another_branch&gt; those changes won’t be merged into your current branch. To fetch and merge the remote changes use:</p><p>git pull origin &lt;another_branch&gt;</p><h4>resolve conflicts</h4><p>conflicts occur when same line is modified in 2 branches. Conflicts can occur while merging another branch into current branch, or while rebasing.</p><p><strong><em>resolve merge conflicts:<br></em></strong>git checkout &lt;branch_name&gt; → current branch<br>git merge master → branch we are trying to merge into current branch</p><p>Conflicts can be fixed manually by editing the conflicted file or by discarding all changes of a particular branch and keeping changes of only 1 branch</p><p>git checkout --ours &lt;file&gt; → to select changes done in &lt;branch_name&gt;</p><p>git checkout --theirs &lt;file&gt; → to select changes done in the master branch</p><p>then continue the merge: <br>git add &lt;file&gt; <br>git merge --continue</p><p><strong><em>resolve rebase conflicts:<br></em></strong>Here --ours and --theirs reverse the roles</p><p>git checkout &lt;branch_name&gt; → current branch <br>git rebase master → rebase from master</p><p>git checkout --ours &lt;file&gt; → to select changes done in &lt;master&gt;</p><p>git checkout --theirs &lt;file&gt; → to select changes done in the &lt;branch_name&gt;</p><p>then continue the rebase: <br>git add &lt;file&gt; <br>git rebase --continue</p><h4>squash commits into one commit</h4><p>git reset --soft master → if current branch is cut out from master</p><p>git commit -m &quot;commit_msg&quot;</p><h4>commit all staged files</h4><p>git commit -m &quot;commit message&quot;</p><h4>commit all staged/unstaged files</h4><p>git commit -a</p><h4>push local changes on your branch to remote</h4><p>git push origin &lt;branch_name&gt;</p><p>your branch is now on remote and is accessible over the internet not just on your system.</p><h4>get latest updates, branches, tags from the remote</h4><p>This won’t pull latest changes to your current working branch, but get new branches, tags that got pushed to remote</p><p>git fetch</p><h4>update your local with remote changes</h4><p>git pull origin</p><p>This updates the current branch that you are currently on with latest changes pushed by others working on the same repo.</p><p>This is same as the combination of git fetch and git merge</p><h4>delete a branch from local</h4><p>git branch -d &lt;branch_name&gt;</p><p>The -d option will delete the branch only if it has already been pushed and merged with the remote branch. Use -D instead if you want to force the branch to be deleted, even if it hasn&#39;t been pushed or merged yet.</p><p>To delete a branch you should be on a different branch from the branch getting deleted.</p><h4>delete a branch from remote</h4><p>git push origin :&lt;branch_name&gt;</p><p>or</p><p>git push origin --delete &lt;branch_name&gt;</p><h4>rename a branch on local</h4><p>To rename a branch switch to the branch that needs a rename and type</p><p>git branch -m &lt;new_branch_name&gt;</p><p>If you want to rename a branch that you are not currently on, then:</p><p>git branch -m &lt;old_branch&gt; &lt;new_branch&gt;</p><h4>rename a branch on remote</h4><p>Firstly, rename the branch on local then execute:</p><p>git push origin -u &lt;new_branch_name&gt; → -u is short hand for setting the upstream</p><blockquote><strong>Note:</strong> Every time you fetch updates from remote or push your changes to remote you have to mention the origin. To skip mentioning the origin all the time, you need to set the upstream:</blockquote><blockquote>git branch --set-upstream-to origin</blockquote><blockquote>then you can just execute git pull or git push and it will push/pull latest code from the origin.</blockquote><h4>see git history</h4><p>git log → it’s a record of commits.</p><h4>tagging</h4><p>You can use tagging to mark a significant change, such as a release:</p><p>git tag &lt;tag_name&gt; &lt;commit_id&gt;</p><h4>push tags to remote</h4><p>git push --tags origin</p><h4>pick selective commits from any branch</h4><p>git cherry-pick &lt;commit_sha&gt; → choose a commit from one branch and apply it onto current branch</p><figure><img alt="visualisation of git branching" src="https://cdn-images-1.medium.com/max/968/1*Zk6GM_uDQAUbdYtHPpZjZw.png" /><figcaption>git branching</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1408989cf212" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Display Base64 encoded images in email using Java]]></title>
            <link>https://mumzee.medium.com/display-base64-encoded-images-in-email-using-java-878e23534f9c?source=rss-f25a334de851------2</link>
            <guid isPermaLink="false">https://medium.com/p/878e23534f9c</guid>
            <category><![CDATA[base64string]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[gmail]]></category>
            <category><![CDATA[mail]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Mumtaz]]></dc:creator>
            <pubDate>Sun, 19 Jan 2020 14:46:40 GMT</pubDate>
            <atom:updated>2020-09-16T08:34:52.998Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s say that you have an HTML template with &lt;img&gt; tags. Normally to display a base64 encoded image in a browser you would do</p><p>&lt;img src=”data:image/png;base64, base64EncodedString&quot; /&gt;</p><p>But this approach won’t work for all mail clients. For instance Gmail blocks display of all base64 encoded strings for security and spamming reasons. By providing the image with a Content-ID (prefixing it with cid:) and attaching it to the mail and later referencing this image in the body of the message, this issue can be solved.</p><p>This is how we can achieve this, by adding an Image part to a multi part message:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de1024f50cbbf1d82363d3aeb299b7f6/href">https://medium.com/media/de1024f50cbbf1d82363d3aeb299b7f6/href</a></iframe><p>And in your html template you should have</p><p>&lt;img src=&quot;cid:qrImage&quot; alt=&quot;qr code&quot;&gt;</p><p>That’s it, now Gmail and other mail clients should display all the inline images.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=878e23534f9c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create Rest API to download Apple wallet (.pkpass) file using Spring, Java]]></title>
            <link>https://mumzee.medium.com/create-rest-api-to-download-apple-wallet-pkpass-file-using-spring-java-bd66e4eb8f3e?source=rss-f25a334de851------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd66e4eb8f3e</guid>
            <category><![CDATA[apple-wallet]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Mumtaz]]></dc:creator>
            <pubDate>Sun, 19 Jan 2020 11:58:09 GMT</pubDate>
            <atom:updated>2020-01-19T11:58:09.998Z</atom:updated>
            <content:encoded><![CDATA[<p>An Apple’s wallet pass is nothing but a bundle, a zipped folder containing :</p><ol><li><em>Resources</em> like logo, background image, translations</li><li>A pass.json file which defines the pass, contains some metadata information and indicates how each of the images have to be displayed in the pass.</li><li>A manifest.json<em> </em>file which describes files inside the pass and has SHA1 checksums of each of the files.</li></ol><p>But before we can get started you need to:</p><ol><li>Create an Apple developer account, if you do not already have one.</li><li>Get a .p12 certificate file along with the password to open this file. This will contain Pass type identifier which is needed for digitally signing your Pass for use with Wallet. Type identifier is a String value using reverse DNS style — for example, pass.com.example.id-card .Please note that only admins of Developer account will be able to create this certificate. To create this certificate follow these steps or refer <a href="https://support.airship.com/hc/en-us/articles/213493683-How-to-make-an-Apple-Pass-Type-Certificate-for-Mobile-Wallet">this blog post</a>.</li></ol><ul><li>In <a href="http://developer.apple.com/account">Certificates, Identifiers &amp; Profiles</a>, select Identifiers.</li><li>Under Identifiers, select Pass Type IDs.</li><li>Select the pass type identifier, then click Edit.</li><li>If there is a certificate listed under Production Certificates, click the Download button next to it.</li><li>If there are no certificates listed, click the Create Certificate button, then follow the instructions to create a pass signing certificate.</li></ul><p>3. Get Apple’s WWDR certificate from <a href="https://developer.apple.com/support/expiration/">here</a>.</p><p>So let’s get started.</p><p>In this post we will be designing a <em>generic</em> pass and create the bundle (zipped folder with all resources, json files) programatically. A <em>generic</em> pass has the following sections:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4DrrbWAs9-TZ03KNGtTu_Q.png" /></figure><p>For list of all supported pass types refer Apple documentation <a href="https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/YourFirst.html">here</a>.</p><p>Let’s say we have a User with following fields which will be displayed on the pass:</p><ul><li>firstName</li><li>lastName</li><li>uuid — displayed as QR code</li><li>uniqueID</li><li>imageURL — the profile photo of the user</li></ul><p>We will use jpasskit Java library. Source code of the library can be found <a href="https://github.com/drallgood/jpasskit">here</a>. I am using gradle to build my code, so to include the library in your project add following to your build.gradle file:</p><pre>compile <strong>group</strong>: ‘de.brendamour’, <strong>name</strong>: ‘jpasskit’, <strong>version</strong>: ‘0.1.1’</pre><pre>compile(‘com.google.guava:guava:23.2-jre’)</pre><p>We do not want to save the Pass in the file system. As and when the user requests we create a byte array representing the zipped bundle of a .pkpass file and write it to the response. The library exposes equivalent methods if you want to physically save the Pass on the system.</p><p>Let’s create a Service class:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/67974305b0a9aab9843605d894156d53/href">https://medium.com/media/67974305b0a9aab9843605d894156d53/href</a></iframe><p>Create a Controller class:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ff40f012bef76115a0c1fc6c0e2492e/href">https://medium.com/media/7ff40f012bef76115a0c1fc6c0e2492e/href</a></iframe><p>It is very important to set the Content-Type to application/vnd.apple.pkpass for browsers to understand that it is wallet pass file.</p><p>So when the browser sends GET requestto https://.../passkit the pass gets downloaded with filenameuser_id_card_userFirstName_userLastName .</p><p>And it looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*jqcxY3qXBsO7BMIodrqmjg.png" /><figcaption>pass as displayed in Mac</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd66e4eb8f3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>