bookmark_borderA fast way to reformat code in PHPStorm

Today I found a way to do a regex find that makes reformatting code easy.

Let’s say we have some code like this:

<p>{{$variable}}</p>

and you want it formatted like this:

<p>{{ $variable }}</p>

This is what I prefer because it gives more breathing room and makes the code easier to read. But these can be scattered in many places in your code.

By doing a global find/replace using this regex, you can replace them all in one shot:

\{\{(?! )

It uses a negative lookahead, which means it will find all occurrences of {{ that are not followed by a space. You could find the closing portion by reversing it. Then use the global replace function and make your commit.

Get in, get it done, move on to the next task!

bookmark_borderPipelines

Have you heard of the pipeline pattern? The pipeline pattern is used by Laravel internally, and is a really nice way to clean up your code.

I found a video that explains it well. I watched yesterday, then today I did a code-along and built it myself to reinforce the concepts. If you havenโ€™t used this pattern before, definitely check out the video and learn something new today! ๐Ÿ˜Š

bookmark_borderKeeping busy during trying times

Having so much time off as I have lately, I’ve been taking the opportunity to clean up my online digital world a bit. Things like creating headers for all the social accounts tied to our BarooBoos brand, and creating as many videos as possible for our YouTube channel. I’ve also been hard at work putting Amazon ads on my sites, ScottyFan.com, BarooBoos.com, kronos.kennyray.com, and of course this one.

I’ve also been doing some paid work for a friend, redesigning a WordPress template for her ministry site Next Level Moms. There certainly is no shortage of things to keep me busy!

I hope to start hearing from recruiters again soon, so that I can get back to a consistent income, but in the meantime I’m working hard to set up as much supplemental income as I can. Any support you can offer by clicking through to my sites, and subscribing to my YouTube channel would be most appreciated!