I had accidentally committed my node_modules folder in my new git repo and wanted to remove it from my git repo without losing my actual node_modules folder itself.

Turns out there’s a nice easy way to do that.

First, add a line for node_modules to your .gitignore file (or have one generated really nicely by https://www.gitignore.io).

Then use this line on the command line to clear node_modules from your git:

git rm -r --cached node_modules

Then commit and push that change:

git commit -am "node_modules be gone!"
git push origin master

Success! Hooray! A neater git repo.

Very quick blog post just to remind myself and others how to force IE8 to display pseudo elements correctly!

Issue: IE8 is not showing pseudo elements on a child element of a parent that has just appeared. For example, pseudo elements on menu items aren’t appearing when the menu opens. They appear only once you’ve hovered over the element or interacted in some way.

Fix: Update the pseudo element on hover of its parent element.

A simplified example is below. We set the content value normally here:

ul.menu li ul li.parent > a:after {
  background: url("fancy-arrow-thing.png") no-repeat top right transparent;
  content: "";

Then on hover of its parent, we change its value to be one blank space:

ul.menu li:hover ul li.parent a:after {
  content: " " !important;

That seems to fix the bug! Hooray!