Posts

Showing posts from August, 2019

Trim Unnecessary Files From Git History ✂️🗃️

Image
Here's a common scenario, You have committed a file to your git repo and have also pushed to remote. The file wasn't supposed to be there, maybe it was something you forgot to mention in your`gitignore` or something that was supposed to be an environment variable or maybe it was a binary not related to the project at all ( Cat GIFs? 😉). This not only raises some security concerns but also drives the  size of your repository up and simply deleting the file won't fix the problem. Here's how to fix it using a few commands: 1) Clone your repo and make sure all branches are up-to-date with remote. 2) Identity the filename and its path that you want to remove. 3) Then using git filter-branch remove the files from history. git filter-branch --tag-name-filter cat --index-filter \ "git rm -r --cached --ignore-unmatch filename" --prune-empty -f -- --all 4) Remove the files from the local repo. rm -rf .git/refs/original/ git reflog expire...

Navigating JavaScript 🤷‍♂️⁉️

Image
JavaScript? JavaScript is taking the world by storm, once used to add functionality to the web, now it is being used in almost all types of software development. For example, Using JavaScript you can do things like build Progressive Web Apps (web apps with native app like features) , create desktop apps using electron, make Android & iOS apps with React Native, do server stuff using Node and Express and many more. If that wasn't overwhelming and confusing enough,  there exists more flavours of JavaScript out there than you can count 😵 & what is JavaScript and what's not is a post for another time. So how do you get started with this interesting piece of technology? 1️⃣ The first thing you should do is learn Vanilla JS . Strong fundamentals go a long way. I will suggest JavaScript30 a free course by Wes Bos, that focuses on Vanilla JS. 2️⃣ Next get familiar with JSON , which stands for Javascript Object Notation. It is mostly used for data storage ...