About Mark

I'm a web designer

Good email regex


This is just one I found and seems pretty good

After adding .env to the .gitignore file, use to remove it from git. To remove it completely from the history use

To “map” through a js object use “for in” First we get each item in the object and call it ‘person’ to make it easier to read. Then loop through it’s data to populate the array. In our example “data” … Continue reading

Let’s say for example we have a back end function that checks if you are under age from a user’s date of birth. First we load that function: Then we set up some test data, like so: We then run … Continue reading

Background-size cover makes the image cover the whole screenBackground-position center centers the imageBackground-attachement fixed makes it so the image doesn’t move when you scroll down the page.

Using Reduce


Reduce is used somewhat similar to ‘map’ Zero is set as the initial value and then it goes through the array and adds each value (in this example the currentScore) to the totalScore which becomes the new ‘previousScore’. Here’s a … Continue reading

This was from a long time ago. I think it had something to do with browser compatibility or device compatibility. Leaving it here in case it’s useful in the future.

The ConditionalWrap component checks the condition (in this example the element.url) and if it exists put the wrapper around the children, otherwise just render the children. The wrapper in this example is a link. You can put whatever content you … Continue reading

First use “git log” to find the commit hash of your merge and copy it somewhere. Then use You can then recommit with the comment of “revert merge” or something similar

An example when you could use this is when the video has ended to automatically close the video player and go back to the website.