How to Ignore Files with Git that Have Already been Committed

After setting up the beginnings of the chess game in my IDE I found that there were a lot of files that I accidentally committed but did not need committing as they were related to the IDE. The others in the group are using different IDE’s and have no need to see those files related to my IDE. Adding the folders to .gitignore wasn’t enough to remove what was already committed and pushed to GitHub.

After searching around StackOverflow I came across this post which pointed me in the right direction. I ended up using the command suggested by Nate in response to the accepted answer. I’m not keen on copying/pasting but figured that since I won’t be pushing any updates until I see it works then this will be fine. If everything broke, I could just re-clone the project.

The command I used:

git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached
… 
 

Creating a Chessboard with Pygame Part 1

I mentioned recently that I was learning Python. I’m working with a few friends on learning the basics. My background is mostly Objective-C and in recent years, Swift. I also programmed in PHP last year for several months working with Laravel, Lumen, Lighthouse, and GraphQL.

To learn Python we decided to begin looking at making a chess game using Pygame. This post shows my attempt to get the chessboard on the screen. I opted to store the coordinates of each square in a class along with their size and if they are black or white. I don’t yet know if this is an efficient way, but for now, it’s helping me learn the Python syntax and work with a few nested loops and a multidimensional list.

… 
 

Learning SwiftUI

In 2020 I swapped from primarily doing iOS development to doing some backend PHP work for several months where I used a custom microservices framework and then switched to Lumen, and then to Laravel, and then integrated GraphQL with Lighthouse to make backend APIs for a couple of different projects. It was all good fun for those months, but I’m now back to what I enjoy most which is iOS app development.

With SwiftUI launching at WWDC in 2019, I didn’t get to spend much time using it other than running a few tests to see what it was like and becoming familiar with Text, VStack, HStack, and various other views. I liked it in 2019. It was only this year, 2021 when I decided to pick up on it again more seriously.

What I have found so far is that SwiftUI is great at some things, but introduces new challenges of breaking away from the traditional way of structuring a program. In the past, I structured my projects so that the ViewController contained just enough code to handle putting information on the view and responding to touches. The logic was separated into business objects which then communicated with various models. This allowed for the logic of the app to be reused elsewhere in the app and not be tied to a single view.

To get more familiar with how SwiftUI works and how it works in an app environment I have started creating a test app to work out what works well. One good example I found from Apple is the Fruta test app that utilises a three-column layout, state objects, nested SwiftUI views, models, amongst other things. Although I won’t be using the three-column layout for my tests, I will be using the other things mentioned, but I won’t really be mentioning what I’m using specifically in this post. I simply wanted to mention Fruta because it’s a great example from Apple.

…