Categories
Uncategorized

Vue Testing Library didn’t work with Laravel

Broken code inside one of the dependencies of VTL, which I suspect is a conflict with the my versions of something else.

If I revisit it will try the Laracasts guide which uses the lower level library + manually pairing it with a test runner such as Jest.

Categories
WordPress

Updating SVN Repo

You may update without changing the code. This happens when I test a plugin with a new version of WordPress and don’t need to make any code changes.

Update the readme.txt with new info, then:

svn ci -m "My cool message"

This is the same command to push new changes that do involve updated code.

If SVN is unauthenticated use your wordpress.org account username (which is not the email address) and password. For me that is mikehealy.

Categories
Workflow

Remove Files from Git Repo

From: https://medium.com/better-programming/how-to-remove-committed-files-from-git-version-control-b6533b8f9044


  1. Create a .gitignore file, if you haven’t already
  2. Edit .gitignore to match the file/folder you want to ignore
  3. Execute the following command: 
    git rm --cached path/to/file
  4. Git will list the files it has deleted. The --cached flag should be used if you want to keep the local copy but remove it from the repository.
  5. Verify that these files are being deleted from version control using git status
  6. Push the changes to the repository

After completing these steps, those files should be removed from version control but not removed from any local machine. Any other developer which pulls again after you pushed your changes should have no issues.

How To Remove Committed Files From Git Version Control

Categories
Workflow

Rename Default Git Branch

Rename on Github first.

Then:

git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
Categories
PHP Workflow

Upgrading Local PHP with PHP-FPM

Updated and linked new version with Homebrew. Update path in terminal manager may help third party programs too.

PHP comes with its own PHP-FPM. For the new version I modified its config to run on a new port.

/usr/local/etc/php/8.0/php-fpm.d

e.g. ran this version at 127.0.0.1:9080

brew services restart php

Then in nginxcfg for a virtual host I updated its config to call php-fpm at that port. That site runs PHP 8.0. Others using old port seem to still be working with PHP 7.4.6. Unsure if that will survive a restart, or if only one version of php-fpm will be running (?)

Categories
WordPress

WooCommerce PayPal Checkout is slow

When active it sends an HTTP API request on every page load to PayPal. Adds >1 second to every frontend page render.

How does this shit pass QA?

Categories
Uncategorized

Don’t Write Your Own Tailwind

Creating some, but not enough, utility classes was a mistake. Should just use Tailwind, or not, but not half and half.

Categories
Workflow

Restart Nginx Locally Mac

sudo brew services stop nginx
sudo brew services start nginx


Sudo because I have it bound to :80, which is otherwise not allowed.

Seems to work better than singular restart command (I think)

Categories
DevOps Servers

Envoyer Deployments

Update: build is passing. Now configure Envoyer to not deploy on push, but instead wait for webhook call from Chipper CI.


Not yet working for HadCoffee staging site. The clone and setup fails because ‘mike’ user that I am connecting with needs to use sudo to interact with the www-data files. Envoyer doesn’t sudo the commands.

Not sure if my Ubuntu users are incorrect, or if Envoyer should be using a different user that can do its work without sudo. Probably the latter.


Changed project to be owned and group of mike, which Envoyer uses. Now it can deploy.

I did have to manually make storage (symlinked) belong to www-data so Nginx can write there.

Now just need npm/node to work. I really don’t know why it isn’t, but it’s stopping me from building the CSS & JS.


npm install worked now that it’s owned by mike.

Potential remaining issues to test with future deployments:

  • Do Frontend assets build now?
  • Is .env maintained? Was I right to create the file?
  • Are file uploads, and S3 push working?

General question: How do DB migrations work in production?

Categories
Workflow

Nginx fails after reboot

I later discovered…

I’d previously pointed a real domain to localhost for local dev. Nginx started at that time. I later changed hosts file and removed that connection. That caused Nginx to do a DNS lookup, and then fail to bind to the IP and refuse to start.

Once I removed that site from nginx/servers I was sweet!


Somewhere it’s trying to bind to a specific local network IP. If I’m at Wotso that failed and I started towards config debugging hell.

Restarted at home and it was ok. That’s a terrible setup, but it worked around it for now.

nginx needs to be started with sudo in order to listen on port 80.