Author: Mark
-
Close the iOS video player with jQuery
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.
-
Adding a blur function in React
An example is to hide a menu if you click off it. This is an example function which changes the variable that affects the menu. Then just add the function to the menu container.
-
How to rebase in Git
I’m not a GIt expert. This is just how I do it. 1st line fetches the latest code from the main repo. 2nd line resets your local branch the latest stage of the master branch 3rd line is just a regular commit 4th line is the force push. This will put all your changes into…
-
Stop a page from redirecting
Put this in the console: This is useful if you want to inspect a page that auto redirects.
-
Looping though arguments in a mixin
Things to note here: The last argument ends with … which means it accepts any number of arguments and will put those arguments into a list. #{nth($items, $i + 1)} gets the argument from the list. You just specify the list and the index. Unlike arrays, the index of the first element is 1. The…
-
Turning a 2nd modem into an external Access Point
I’ve done this a few times already so thought it would be a good idea to document it. What this does is basically make a 2nd wifi spot using your original wifi. Get the original modem’s ip address (usually 192.168.1.1) If not check by typing “ipconfig” in the command line on a computer that’s connected…
-
Using @at-root to break out nesting in SASS
An example would be a close button, where it’s primary goal is to close an overlay but it could be used in other cases maybe like a popup and so you don’t want to restrict it to be a parent of the modal and want all close buttons to be styled the same.
-
Using Context in React
Using context allows access of certain data within all components inside the “provider” without having to pass them as props to the children. First create the context: Then make the provider: Here, we import the context, and set up the data we want to share in the state and also a function that toggles the…
-
Using the children prop
This allows you to put children elements directly in the output:
-
Storing multiple values in useState
Here’s an example: When updating you need to use “…[object name]” so the other value(s) stay in tact.