Snippets frequently used with Sage
We did it! We broke gist.github.com ;) So head over to the new home! Thank you all!
2021.10.20: https://github.com/AveYo/MediaCreationTool.bat now open for interaction
Not just an Universal MediaCreationTool wrapper script with ingenious support for business editions,
A powerful yet simple windows 10 / 11 deployment automation tool as well!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Delete orphan postmeta | |
DELETE pm | |
FROM wp_postmeta pm | |
LEFT JOIN wp_posts p ON pm.post_id = p.ID | |
WHERE p.ID IS NULL | |
; | |
-- Delete orphan attachment | |
DELETE p1 | |
FROM wp_posts p1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Using WP Statuses for custom Post Types. | |
* | |
* @link http://github.com/imath/wp-statuses | |
*/ | |
// Exit if accessed directly. | |
defined( 'ABSPATH' ) || exit; |
Instructions to obtain ZSH on a windows environment, without the input funny business presented by some other attempted solutions.
The final result is ZSH running on a mintty terminal, emulated by cygwin, and being handled by the popular cmder.
For the benefit of myself and others. I've already followed these instructions twice. It took me hours to figure all this out, maybe someone else can save a few.
- Installing and setting up cmder
public class Hello
{
public static void Main()
{
- System.Console.WriteLine("Hello, World!");
+ System.Console.WriteLine("Rock all night long!");
}
}
- You need the rights to reopen pull requests on the repository.
- The pull request hasn't been merged, just closed.
- Write down the current commit hash of your PR-branch
git log --oneline -1 <PR-BRANCH>
- Write down the latest commit hash on github before the PR has been closed.
git push -f origin :
- For your local dev, create a
Dockerfile
that is based on your production image and simply installxdebug
into it. Exemple:
FROM php:5
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LXB_AF_Checkbox extends WP_Customize_Control { | |
// I'm not sure where this gets used but it's in the codex. | |
public $type = 'checkbox_group'; | |
/** | |
* This method must be named, exactly, 'render_content', as that's | |
* expected by the WP core cusotmization class, which it extends. It | |
* outputs the HTML for our custom input. | |
* |