Sorting swift array

We can easily sort a swift array using two provided function array.sort array.sorted We will see both array.sort() and array.sorted() in action and will understand how they differ from each other in a subtle way, while sorting a swift array in place and returning a sorted copy of the swift array. Example code for the … Read more

Convert degrees to radians and radians to degrees

In real life, we are used to degrees and in programming, we deal mostly with radians. If you are dealing with drawing specifically arc and circles you will come across situations where you have to toggle between degrees and radians and at other times between radians to degrees. Relationship between Degrees and Radian The above … Read more

Deleting 9gag comments easily

It is a very tough job to delete 9gag comments from a very active thread as your comment will be hidden somewhere amongst thousands of comments. But I will share with you an easy way to do it. Using this method you will be able to go to your comments directly one by one and delete them no need to search for needles in a haystack.

Remove a file from tracking in git

So you have added a new file to .gitignore or you have just added a new .gitignore file to your existing repo. The problem is same you don’t want git to rack one or many files. This can be archived in simple 3 step process. Assuming that you have already added or updated .gitignore file … Read more

Delete a git branch from local and remote

Git branch can be deleted easily using following commands Most of the time remote name is origin. For deleting git branch locally you can use following command If you are working in a large team and you don’t want to keep deleted branch locally you can prune your repo by using following command Hope this … Read more

Git revert to previous commit

There are situation when you mess up so bad you want to just go back and restart again. Fortunately If you are using Git then you can do it. We will be discussing ways in which git allows you to revert to previous commit 1.Git reset Git rest moves your head to a specific commit. … Read more