Tag: Code
-

Split sections with CSS Grid with NO floats
Parent container’s CSS #1 – This will split things 50/50 However, if you want to add space inbetween these columns with column-gap: 1em, your right child container will get pushed off to the side, which might not be desirable. Parent container’s CSS #2 – This will split things 50/50 and you can add space inbetween WITHOUT…
-

Find out if items in Array1 can be found in Array2
I have 2 arrays, and I wanted to find if there were some items that overlapped! This is how I did it: or
-

Join and flatten arrays into a single master array
Sometimes you get janky-ass data… so you needed to join a bunch of arrays into one single “MASTER” array. Here’s what I did.
-

Deploying a Static Website to AWS
1 – You need to have an AWS s3 Account 2 – Install the AWS CLI (https://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html) 3 – Configure you AWS Credentials 4 – Configure your package.json to make things easier 5 – Deploy
-

My Go-To Media Queries
When I’m making a website from scratch I always end up scratching my head on what breakpoints to use for the media queries. There’s just a TON to use. These are my ULTRA SIMPLE go-to media query breakpoints. It’s super simple because there are only two sizes to think about! Small shit vs large shit.
-

(Swift) Creating a Custom Delegate
Exposing a function from UIViewController A to a CUSTOM UIVIEW such that you can call it. CUSTOM UIVIEW UIViewController A
-

(SCSS) Get-Map
Creating variables, or tokens, is pretty handy when you want to tidy up your styles. You can create what I call a grouped variable. You can then use the variable like this:
-

(SCSS) Nesting with at-root
Use @at-root to extend your styles.
-

Check for color with Regex
Hey, are you in need of checking if a string is hex, rgb, rgba, hsl, and hsla? Look no further. Regexr Example
-

Remove Mirage Logs
These past couple of days I’ve been using Mirage, and the console will output a bunch of messages by default. To turn them off, use the following in your config.js:
-

Command to Compress and Password Protect
Lately I’ve been needing to send some folks password protected zip files. Below is a short and basic snippet that you can use to run in your terminal. Once your run the above snippet, enter a password. oldFolder is the folder with your contents newFOLDER is the name of the outputed zip file of this command The output will…
-

Transform camelCase a Camel Case with Regex
I’m quite terrible at regex, but lately I figured that I actually really need to learn it. Below is a snippet for transforming “camelCase” strings into “Camel Case” strings.
-

Troubleshoot ESLint $ Errors
-

Align Divs on a Line
A few days ago I had to make a few divs of varying height. Unfortunately, they were looking a little wonky because they weren’t aligning. I made them display: inline-block, but what’s going on? Making my divs display as inline-block was to make my divs appear on the same line. However, it was not enough to make them straight. TLDR; I had…
-

Copy Text With JS
I found this jewel somewhere:
