Skip to content

Instantly share code, notes, and snippets.


Denis Žoljom dingo-d

View GitHub Profile
dingo-d /
Created Sep 19, 2022
Scripts to quickly create wp site using wpcli
# WP-CLI site setup for Windows
# Usage create-site {folder name} {database name} {site title}
create-site () {
if [ $1 ]
mkdir $1 && cd $1
wp core download --skip-content;
wp config create --dbname=$2 --dbuser=root;
dingo-d / BookCptOOPTest.php
Last active May 16, 2022
Example of WP unit tests with Pest. Doesn't include the entire setup, for that you can check
View BookCptOOPTest.php
use TestPlugin\Cpt;
// Unit test with OOP code.
it('checks that the hook is registered for custom post type registration', function() {
(new RegisterBookCpt())->register();
dingo-d / application-blocks-editor.js
Created Jul 14, 2021
Color picker meta that adds inline css variable using ACF color palette
View application-blocks-editor.js
// Only run if ACF is active.
if (typeof acf !== 'undefined') {
acf.add_filter('color_picker_args', function (args, $field) {
// Add predefined color palette.
args.palettes = ['#5D2BFF', '#FFE194', '#E45353', '#96DFFF', '#FFBDA7', '#8CEAB7', '#ECA7C8'];
return args;
dingo-d /
Created Jun 12, 2021
Fixing the valet and DNS resolving in WSL2

If the local sites aren't working, or some services, these are possible fixes.

Check the /etc/resolv.conf file, it should look like this

# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
generateResolvConf = false
dingo-d / docker-composer.yaml
Created May 22, 2021
Example of docker compose file with WP and WP-CLI (allowed root). Note to self: when specifying command parameter in the compose file you'll need to add the default entrypoint and commands that are running on the default image you're pulling info from.
View docker-composer.yaml
version: "3.9"
image: mysql:5.7
- db_data:/var/lib/mysql
restart: always
MYSQL_ROOT_PASSWORD: somewordpress
dingo-d / .zshrc
Created May 22, 2021
My default .zshrc config
View .zshrc
# If you come from bash you might have to change your $PATH.
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See
dingo-d / build.log
Created Jul 21, 2020
The build log for phpbrew mbstring extension /Users/denis.zoljom/.phpbrew/build/php-7.4.7/ext/mbstring/build.log
View build.log
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
checking for grep that handles long lines and -e... /usr/local/bin/ggrep
checking for egrep... /usr/local/bin/ggrep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
dingo-d / gist:d72fd01e69b73be99fad267796c03410
Created Jul 20, 2020
Installing extensions using phpbrew
View gist:d72fd01e69b73be99fad267796c03410
phpbrew ext install github:php-amqp/php-amqp
dingo-d / conf.phperrorlog
Last active Jul 17, 2020
Config examples for debug, and error logs with grc:
View conf.phperrorlog
# Highlight time
regexp=^\[\d\d-[A-Z][a-z][a-z]-\d\d\d\d \d\d:\d\d:\d\d [A-Z]{3}\]
# Highlight file paths with lines at end
View index.html
This file has been truncated, but you can view the full file.