PHP Lint has got your back

Hopefully, you have one of those friends who has your back, who will step in and stop you from making a really, really stupid mistake. Because we all are fallible and whether it be in a moment of rage, or just because we are in a rush, we will make mistakes.

This is why I have PHP Lint added as a pre-commit hook on my PHP Project repos. It only takes a minute to set it up and will have you a ton of time, and headache in the future.

First, you need to make sure you have PHP Lint installed on your system. If you are a PHP developer, then the chances are you have it.

Next go to you PHP project .git directory and add the following code to the file .git/hooks/pre-commit


And that should be it. Now every time you do a commit on some PHP code, your git workflow will send each file through the PHP Linter to check for errors. See the example below

Most editors will show you when you make an error, but we are rushing and don't notice that we forgot to add a semi-colon.

routes_php____Documents_GitRepos_DiegoDev_iParq_core_app_Http__-_VIM

We add the file and attempt to do a commit but because of the hook, Git will refuse to commit the files, and we can sleep easier at night knowing we can't accidentally send broken code to our repo.

2__eric_DiegoDev____Documents_GitRepos_DiegoDev_iParq_core__zsh_

One thing to note, this git hook will only parse the files you are committing and not the entire project. Meaning if you have a co-working was not doing linting, and you pull in their changes but don't touch the file, your commit will not catch it.

Making PHPStorm act more like my Vim

I've been using Vim for years, and I have built up a lot of muscle memory. I also have a few Vim plugins I feel like I can not live without, which also have their key bindings. From time to time, I will play with another editor but only if it offers Vim bindings in some form or fashion, typically it comes in the way of a plugin. Usually, these are lacking a great deal, and it's not long before I am back in native Vim.

One exception to this rule has been PHPStorm. The Ideavim plugin was very complete. That, coupled with a ton of built-in features and a few other plugins like Relative Line Numbers and AceJump I found myself able to get the PHPStorm IDE very close to my native Vim.

This is mainly due to Ideavim's approach which mimics the .vimrc file. Ideavim has the .ideavimrc file which allows you to map custom mappings just like .vimrc but does have some limitations.

In my .ideavimrc file, you will notice several mappings that take advantage of an :action command. The 'action' is a command gives you access to any command within PHPStorm, including commands added by other plugins. With this, I can mimic several commands from my regular .vimrc file that use plugins such as the mappings I have for Fugitive.

It's not a seamless replacement for native Vim, there are a few things that annoy me, and I will switch back to native Vim for development from time to time, but Ideavim gets PHPStorm closer than any other tool and makes working in PHPStorm relatively easy.

My Current .ideavimrc file can be found in my dot_files repo on Github at  https://github.com/ericvanjohnson/dot_files/blob/master/.ideavimrc

Here it is below as well:

Talking Laravel

If you know me, you know I am a sucker for a good framework. Doesn't matter the language I am using, I will typically look for the hottest framework on the platform when I start a project.

In my primary development world of PHP, that framework had been cakePHP for a very long time. I had tried several others, but none of them stuck with me like cake did, that was up until a few years ago when a friend with our San Diego PHP User Group started pushing another framework on me called Laravel.

In that time, I've taken the Laravel framework further that I have any other including starting a development group that specializes in the framework. As typical, when I do something I like to submerge myself totally in it, and it wasn't too long before I found myself running a User Group for the Laravel framework.

During that time, I've had the opportunity to speak with a few of the key members of the Laravel community. The following two videos are interviews I did with Taylor Otwell (@taylorotwell) who is the creator of the Laravel Framework. The second video in my interview with Jeffrey Way (@jeffrey_way) who I consider the head educator for Laravel. Enjoyed talking with both these guys. They were super friendly and very, very accommodating.

Enjoy

First up is Taylor Otwell, the creator of Laravel. Great discussion with him.

This is Jeffrey Way's video, we had some major auto problems this night, sorry about that. We were able to mute everything when Jeffrey speaks. Also, the video should start at about the 15-minute mark. Everything before that is just some typical User Group meeting stuff.

My PHPStorm Gotham Theme

Inspired by one of my favorite Vim colorscheme vim-gotham, I created a very dark color theme for PHPStorm. You can download it here. Screenshot here.

To install just place the ICLS file in your PHPStorm directory with your other color themes. On my Mac that that location is ~/Library/Preferences/WebIde80/colors.

PHPStorm Gotham Theme

My Favorite PHP User Group Logos

User groups, or UG for short, are awesome. People passionate about some sort of speciality who get together to share and learn from each other. I personally belong to several UGs but there is one that gets more of my attention than the others and that is our local PHP UG. There are several reasons for this, I am passionate about PHP but more importantly I am one of the organizers of this group which just goes by SDPHP.

One fun thing to check out with other UGs is to see what they came up with for a logo. This sounds simple but coming up with a good meaningful logo is tough. These are some examples of my favorite logos from various PHP User Groups. This is by no means a complete list and I may find myself adding to it over the next couple months but if you happen to have a PHP UG Logo you like, feel free to reference it in the comment section.

Now in no particular order, ok expect for the first one, here are some of my favorite PHP UG Logos.

SDPHP
Right off the bat I am going to do some shameless self promotion of my group SDPHP. I designed this logo and we've been using it for a couple years now and I am still not tired of it.

sd-php-logo-1800px


SFPHP
Next on my list is the San Francisco PHP UG, SFPHP. It's very creative and you can tell they put some time into this one.

event_432119478


SEAPHP
Like SFPHP, Seattle PHP User Group managed to work the PHP ElePHPant into their logo which is not something I was able to do.
event_384469132


UPHPU / MNPHP
Utah PHP and Minnesota PHP User Group both use nice circular logos. They look like they would make a great patches.

v3emVRaY_400x400c4146650d629b6990956de3c9cb07a4c_400x400


OCPHP
Orange County PHP kind of speaks for itself. Simple and representative of their local.

event_207535502


SBPHP
Southbay PHP User Group is one of the newer and more creative logos I've seen.

event_432349651


phpbelfast
From our friends across the pond we have Belfast PHP User Group

4d345fc2321087b118d53782cec4eda7_400x400

San Diego / Tijuana Tech Industry

Just wanted to post a link to a really good article on Tech Companies in San Diego and leveraging talent across the border in Tijuana.

I worked for a group that had a very similar business model, it was a little different as the majority of its clients were also based throughout Mexico. I worked with them in their San Diego office with a group of very talented developers, ops, and office staff from both sides of the border.

We did manufacturing in Mexico, a little deeper than Tijuana, and I have to agree with the article in that one of the biggest advantages was being able to quickly iterate through design and components. There is something to be said about being able to travel to manufacturing, discuss with the different teams involved, and pivot if needed.

I would also travel to Tijuana to meet with my tech team who managed IT systems in our Tijuana offices where customer support and designers worked. As I mentioned, in our San Diego office we had developers, graphic artist, office staff, and operation team members who made the journey across the border every day. All very talented people.

I think Baja California is positioned to become one of the next strong draws of IT talent. The skills sets and IT culture south of the border is growing stronger and stronger as the IT generation there are maturing and finding themselves in the workforce. I am hoping as more Tech companies realize this, they also decide to make San Diego their US home.

Here is that link I promised you to the article:

Tech companies thriving in San Diego–Tijuana border zone

I do enjoy going on rides with my daughters. This is an older one that Google put together in a story…

I do enjoy going on rides with my daughters. This is an older one that Google put together in a story line. Most of the photos were taken by my daughter on the back on the bike.

https://plus.google.com/116510298779491278957/stories/d512e486-92de-3465-a312-aafa987cadfb/1?authkey=CKiUwO8E

My Solar Panels are finally online. Got the final inspection notice today and was given the green light…

My Solar Panels are finally online. Got the final inspection notice today and was given the green light to flip the switch. I am now producing more power that I am using and sending the extra back to the grid.