When I was a kid, maybe 8 years old, I would go to the flea market with my parents a couple of times a year. I had a small allowance at the time and would walk around looking for cool things. One time I saw a broken VCR for sale for $5. It was so cool! I asked my mom if I could buy it to take it apart, and soon I was the happy owner of a broken VCR.
When I got home I couldn’t wait to go at it. I sat in the garage with a couple screwdrivers and did my best to dis-assemble the whole thing. I wanted to know how it worked, and what was inside the box.
The Forge UI is great, and takes away a ton of the pain of server and application configuration. Following best practices, we use environment variables to manage environment specific settings like the database name and credentials. One of the features Forge provides is the ability to automate deployment from your github / bitbucket repo upon a post to a specific branch.
The problem we were having was that our migrations would not run. The error was:
In our case, we are using a non-standard repo directory structure where instead of the typical Laravel app directory structure:
we have another layer above:
Upon inspection of the directory on the server, we found the “.env.php” file was in the base directory. The problem with this was that artisan, the application responsible for Laravel migrations, could not see the environment variables, and so the database configuration was wrong. The solution was simply to move .env.php file into our “laravel” directory so that artisan had access to it.
In a recent project I was trying to create new users with just their email addresses in an instance of WordPress Multisite. To do this, I planned to use the email address as the new user’s username. But I kept getting this error:
“only lowercase letters (a-z) and numbers are allowed”
In case you run into this problem to, there is a solution: the Network Username Restrictions Override plugin. There’s a setting in the plug to allow email addresses for usernames. Click that and you should be good to go.
Here’s another way to solve the same problem that overrides the error that pops up if you try to use an email address as a username in WordPress Multisite. It attaches a custom filter to the the ‘wpmu_validate_user_signup’ hook that unsets the email address error.
“I’m glad you came to talk to me, it’s a relief really”, my coach said.
I was sitting on the couch in the Cornell wrestling coach’s room.
I had walked on to the Cornell wrestling team two years back, a freshman nobody had heard of from California. I wrestled three years in high school, was team MVP for three years, team captain for two, first in my league for two years, most wins in the high school history, so I figured I could do something like that in college too. Continue reading →
Recently, I added a new feature that significantly changes one of the database tables in my application. I ran into problems when I created a non-reversible database migration, and realized that other branches I am developing on still require the older database scheme. In the end I had to end up dropping the DB, deleting the offending migration, rebuilding the DB, and figuring out a smarter way to migrate. Not fun, and time wasted. Continue reading →
No, not your husband / wife… Nope, not mom. Not your brother or sister. Of course, not your cat. I’m talking about that stupid a-hole in your head that sees the other side to everything you do. I recently went through a period about a week-long where everything was annoying, and that voice was loud. I got upset a lot, was easily offended by others, spent a lot of time counting to 10, recognizing that the outside world had not changed that much, but something was going on in my head. Continue reading →
Ever feel like you want to do something new, but a little voice in your head says “oh… but you can’t”. Maybe you think about it again, and another voice asks “What if you don’t finish?”. And then another voice pops up and says “they’ll think your dumb for not being good at that already…”
Maybe you want to build a website. Or learn to code. Or learn to dance. Or start a company. Or become a great cook. Whatever.
So instead you stop thinking about that new thing you could be doing because it feels bad. It’s like a tease, it excites you and you become vulnerable to the potential, and then those voices come in and cut you down, leaving you feeling silly and impotent. And the world is worse off for it. And you are worse off for it. Continue reading →
Heading into work today I was thinking about how we are the sum of the experiences we’ve had. Our brains have been trained to recognize patterns in people and events and we use these patterns to “expect” what will happen next. Sometimes things don’t go the way we expected them and this makes us distraught, stressed, or upset. And then the image of a PID controller popped into my head, as I’m sure it would have in yours. Continue reading →