Skip to content

Instantly share code, notes, and snippets.

@ridinghoodmedia
ridinghoodmedia / flywheel-local-xdebug-vscode.md
Created December 6, 2020 05:03 — forked from ahmadawais/flywheel-local-xdebug-vscode.md
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install
@ridinghoodmedia
ridinghoodmedia / babel-webpack.md
Created November 10, 2020 15:27 — forked from ncochard/babel-webpack.md
The correct way to compile ES6 using babel...

When you create a npm package, remember it might be used in a browser or a server, or even a command line utility… For each package you create, please pay attention at what it will be used for:

  1. Is it going to be used as a dependency to a nodejs application that is not bundled? (e.g. command line utilities)
  2. Is it going to be used as a dependency to a nodejs application that is bundled? (e.g. AWS Lambdas)
  3. Is it going to be used as a dependency to a browser application (always bundled)?.
  • In cases 2) and 3) you want to allow for tree shaking.
  • In cases 1) and 2) you want to benefit from the "ES6"/"ES next" features supported natively by nodejs.
  • In case 3) you also want to benefit from the native support of "ES6" from your browser.
@ridinghoodmedia
ridinghoodmedia / postgres-cheatsheet.md
Last active December 7, 2017 05:51 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
<?php
function my_acf_save_post_searchwp( $post_id ) {
// re-index the post
SWP()->purge_post( absint( $post_id ) );
SWP()->trigger_index();
// For some reason the above doesn't work unless there is some sort of output below it??
// The js can be any arbitrary even an alert, which causes an error with acf's redirect function
// but still updates the searchwp index
// Without the code below, the post is purged - i.e. the old meta is not found, but the new meta