Migrating sermons from Sermon Manager for WordPress to SermonAudio

I build a Laravel-based command-line utility to import sermons from the Sermon Manager for WordPress plugin and migrate them into SermonAudio.

If it’s useful to you, see this repository for setup and usage details: https://gitlab.com/andrewminion/sermon-manager-to-sermon-audio

Trello to Excel

I was trying to export a Trello board to a spreadsheet and include all the cards and checklists but couldn’t find a good way to do that, so I wrote one!

Originally this project was based on Laravel Zero, a command-line Laravel framework. It accepted a JSON file exported from Trello and exports an Excel spreadsheet:

  • A board becomes an Excel file
  • Each list becomes a worksheet
  • Each card becomes a row in the worksheet
  • Checklist items become individual rows with their name, completion status, and due date

It still does that, but it’s also available now as a webapp for anybody to use simply by logging in with Trello!

Try it out here: https://trello-to-excel.andrewrminion.com/

You can find the source code here: https://gitlab.com/andrewminion/trello-to-excel

Example

Using Laravel artisan tinker and psysh with Xdebug

I often use Xdebug for troubleshooting and interactively debugging local code as I write it.

Laravel’s artisan command is extremely useful for running code interactively during development. (It’s based on another utility named psysh.)

It can be very useful to set some debug breakpoints and then run code interactively using artisan, but occasionally when I run php artisan tinker, the PHP shell just sits there and doesn’t accept any input until I kill my xdebug listener.

Thanks to this issue, I finally have a solution.

Add this to the psysh config file (~/.config/psysh/config.php on macOS):

<?php
return [
  'usePcntl' => false,
];

VS Code and Laravel Tasks

Several of my recent projects are Laravel apps that use Horizon to manage the queue and run jobs.

However, I frequently forgot to run php artisan horizon when opening the project, and sometimes spent a bit of time trying to figure out why a job hadn’t run before remembering. 🤦

In addition—and this is a relatively minor annoyance—even when I do remember to start Horizon, sometimes I’d like to see the metrics dashboard showing how many jobs have run in the past few minutes.

Edit: I added npm run watch to help with Tailwind JIT mode.

Workspace Tasks

Enter VS Code’s Tasks feature. This can automatically start running tasks when a workspace is opened.

To get set up:

  1. Open the command palette (command-shift-P) and activate “Tasks: Manage Automatic Tasks in Folder”
  2. Activate “Allow Automatic Tasks in Folder”
  3. Open the command palette again and activate “Tasks: Open Workspace Tasks”
  4. Add the following to the workspace:

Now every time I open the workspace, assets are rebuilt as I modify them and Horizon and the scheduler run automatically.

Visual Studio Code Workspaces and PHP Intelephense

When developing WordPress plugins for general use, I like to open the plugin directory itself in VS Code.

This allows me to use the git integration and terminal without wading through the wp-content/plugins/{plugin name} directory structure.

However, this results in the WordPress functions appearing as “undefined function” and the inability to jump to their definition or hover to see parameters and other details.

Here’s how I fix that annoyance:

  1. Save the open project as a workspace (File > Save As Workspace…)
  2. Add a fresh WordPress installation to the workspace, making it a multi-root workspace
    • Note: this step is not strictly necessary as noted below.
  3. Go to Settings (Code > Preferences > Settings), click on the “Workspace” tab, and search for intelephense.environment.includePaths
  4. In the “Include Paths” section, add an entry for the fresh WordPress installation so Intelephense will index it

Alfred Workflows

I’ve been using Alfred on macOS for years now and it’s a wonderful productivity enhancement (on average, I use it more than 100 times a day).

Here are some of my favorite workflows:

Alfred SSH

Alfred SSH by Dean Jackson gives you quick access to SSH connections you have defined in your config, as well as quick one-off connections.

Colors

Colors by Tyler Eich is a quick way to preview color codes and convert between formats.

Datetime Format Converter

Datetime Format Converter by Michael Waterfall is the fastest way I’ve found to convert Unix timestamps to human-readable dates, and vice versa.

Dev Doctor

Dev Doctor by Syd Lawrence provides quick-reference lookups for code documentation.

DevDocs

DevDocs by Yannick Galatol is another workflow that provides quick reference for documentation using devdocs.io.

HTTP Status

HTTP Status by Marc Görtz is my preferred reference for quickly finding an HTTP status code either by number or name.

Laravel Docs

Laravel Docs by Till Krüss is amazing…it seems to have indexed most of Laravel documentation, so searching by any key word tends to bring up the best page of the documentation.

Laravel Livewire Docs

Livewire Docs searches the Laravel Livewire documentation.

Open in VS Code

I use Visual Studio Code as my primary development tool; I created this workflow to quickly and easily open a file or directory in VS Code.

TailwindCSS Docs

TailwindCSS Docs searches the TailwindCSS documentation.

VPN Manager

VPN Manager by Dean Jackson is a great way to enable/disable VPN connections on the fly.

WordPress Developer

WordPress Developer by keesiemeijer is the fastest way to search and find functions, filters, classes, and more in the WordPress documentation.

Infusionsoft to Shopify Customer History Migration

A helper utility to copy Infusionsoft contacts and their order history to Shopify, ignoring Infusionsoft contacts who do not have orders associated with their contact ID.

It also optionally pulls info from a WooCommerce installation.

Get the code from the GitHub repository. Continue reading “Infusionsoft to Shopify Customer History Migration”

Listing Unique Font Stacks on a Webpage

I just put together a new tool to list all the unique font stacks on a web page, intended to help with diagnose and remove unnecessary webfonts and save page load time.

Usage

Download this file and include in your page source, or copy-and-paste it into your browser’s JS console, then run the styleInPage() function with the CSS style you want to inspect as the parameter.

Examples

// Show all unique font stacks in use on the current page
console.log(styleInPage('fontFamily'));
// Show a list of all DOM elements with their computed font stack
console.log(styleInPage('fontFamily', true));
// Highlight all DOM elements using font stack 8
var fontStacksInUse = styleInPage('fontFamily');
console.log(fontStacksInUse);
highlightInPage(8);

Unserialize.dev

php iconA quick-and-dirty PHP script to unserialize a string in PHP.

Clone (or download and expand the zip file) into your documents root and point unserialize.dev to the folder.

Note: as of December 2017, Google Chrome requires a TLS certificate to access .dev domains. You can use the script on any local TLD or PHP-capable server without any changes.

Enter your serialized data into the textarea, hit “submit,” and boom!—your serialized data is expanded to a much more human-readable view! Now includes Kint debugger to make it even easier to explore your data. Continue reading “Unserialize.dev”

Alfred MX Toolbox SuperTool Custom Search

If you use Alfred on your Mac and use MXToolbox.com with any regularity, this custom search should save you time.

Add the custom search

Alfred MX Toolbox SuperTool screenshot

Use the keyword “mx” and any of the SuperTool commands listed here to search for the info you need.


Here is another custom search specifically for whois data.

Add the custom whois search

Alfred MX Toolbox Whois information

Here’s an icon you can use, since custom search URLs don’t include images:MXToolbox