HTML Table

Updated: 16 November 2023

<table>
  <tr>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td></td>
    <td></td>
  </tr>
</table>

How to configure PHP, Xdebug, Docker and PHPStorm

Updated: 15 November 2023

1. Select these two items in PHPStorm:
Run > Start Listening for PHP Debug Connections
Run > Break at first line in PHP scripts

2. Load a page in a web browser.

3. PHPStorm should display an Incoming Connection From Xdebug dialog box.

4. From the bottom of the dialog, select the local file which matches the ‘File path on server’ value and click Accept.

Deploy branch from intermediate bare git repo

Updated: 09 November 2023

Scenario

  1. I have a project on BitBucket.
  2. I work on this project locally.
  3. I want to deploy the changes to Production.
  4. Rather than pulling changes directly from Bitbucket to the working directory on the Production server, I need to go via a bare-repo on the Production server. The bare repo has been cloned from BitBucket earlier. This workflow is similar to deployments on Cloudways or Plesk.

Method

1. Push changes from local to BitBucket as normal.

2. From inside the bare repo directory on the Prod server, fetch all the changes from BitBucket

cd /bare/repo/my-proj.git
git fetch origin *:*

3. Transfer the changes to the working directory

cd /anywhere/on/the/system
git --work-tree /path/deploy/dir --git-dir /bare/repo/my-proj.git checkout --force my-branch

Tuxedo laptop with Windows in Virtual Box.

Updated: 08 November 2023

I’ve had trouble running a Windows VM inside Virtual box on my Tuxedo laptop. The VM frequently crashes and sometimes consumes all the RAM of my host laptop also, requiring a restart.

Two good pieces of advice I’ve had from Tuxedo support:

  1. Turn off 3D acceleration: Virtual Box > The VM > Settings > Display > Enable 3D Acceleration.
  2. Limit the CPU the guest is able to use to 75%.

Vim indent

Updated: 09 November 2023

Insert mode, indent current line forward, backwards ctrl-t, ctrl-d

Categories Vim

Case

Updated: 06 November 2023

Kebab case nav-links
Camel case navLinks
Pascal case NavLinks

JetBrains

Updated: 14 November 2023

Create a desktop entry Tools > Create Desktop Entry
Restore defaults File > Manage IDE Settings > Restore Default Settings
Change theme File > Settings > Appearance & Behavior > Appearance
Line numbers File > Settings > Editor > General > Appearance > Show line numbers
Show file in project tree Alt + F1 > Select in Project View

Key bindings (Linux)

Find in files Ctrl + Shift + F
Zoom in Ctrl + Alt + Shift + +
Zoom out Ctrl + Alt + Shift + -
Zoom reset Ctrl + Alt + Shift + 0
Show usages Ctrl + Alt + 7