This post shares from simple to advance the use of For loops
in swift. These can be enhanced and some time shorthand of more lines of code. I hope you would enjoy them and try to use in your coding style. Please let me know your feedback in the comments if you have any. Happy coding.
Author: Alok C
Git (Chapter 12 – Tips & Tricks)
This module presents a broad survey of useful Git utilities. We’ll take a step back from the theoretical aspects of Git and focus on common tasks like preparing a project for release and backing up a repository. While working through this module, your goal shouldn’t be to master all of these miscellaneous tools, but rather to understand why they were created and when they might come in handy.
Continue readingSwift Tips: How to use enumerated() in array
This is very useful if you are trying to manipulate in old school C, C++ way.
Here’s an example:
let array = ["Hulk", "Thor", "Spidy"] for (index, item) in array.enumerated() { print("Found \(item) at position \(index)") }
That will print “Found Hulk at position 0”, “Found Thor at position 1”, and “Found Spidy at position 2”.
Git (Chapter 11: Patch Workflows)
Thus far, all of the collaboration workflows we’ve seen rely heavily on branches. For example, in the last module, a contributor had to publish an entire branch for us to merge into our project. However, it’s also possible to communicate directly on the commit level using a patch.
Continue readingGit (Chapter 10: Distributed Workflows)
Now that we know how to share information via a centralized workflow, we can appreciate some of the drawbacks of this collaboration model. While it may be convenient, allowing everyone to push to an “official” repository raises some legitimate security concerns. It means that for anyone to contribute content, they need access to the entire project.
Continue readingGit (Chapter 9: Centralized Workflows)
In the previous module, we shared information directly between two developers’ repositories: my-git-repo and marys-repo. This works for very small teams developing simple programs, but larger projects call for a more structured environment. This module introduces one such environment: the centralized workflow.
Continue readingGit (Chapter 8: Remotes)
Simply put, a remote repository is one that is not your own. It can be another Git repository that’s on your company’s network, the internet, or even your local filesystem, but the point is that it’s a repository distinct from your my-git-repo project.
Continue readingGit (Chapter 7: Rewriting History)
The previous module on rebasing taught us how to move commits around and perform some basic edits while doing so, but now we’re going to really get our hands dirty. We’ll learn how to split up commits, revive lost snapshots, and completely rewrite a repository’s history to our exact specifications.
Continue readingGit (Chapter 6: Rebasing)
Let’s start this module by taking an in-depth look at our history. The six commits asterisked below are part of the same train of thought. We even developed them in their own feature branch. However, they show up interspersed with commits from other branches, along with a superfluous merge commit (b9ae1bc). In other words, our repository’s history is kind of messy:
Continue readingGit (Chapter 5: Branches Part 2)
We’ve covered the mechanics behind Git branches, we can discuss the practical impact that they have on the software development process. Instead of introducing new commands, this module covers how the typical Git user applies this workflow to real projects, as well as some of the problems that arise in a branched environment.
Continue reading