Skip to content

Instantly share code, notes, and snippets.

View allysonsouza's full-sized avatar
💻
Doing some WordPress stuff...

Allyson allysonsouza

💻
Doing some WordPress stuff...
View GitHub Profile
@allysonsouza
allysonsouza / commands.md
Last active August 8, 2024 13:18
[Create Block] #wordpress-create-block #create-block
npx @wordpress/create-block@latest -t "static" --namespace "ctl" --title "Example Static" --slug "example-static" --short-description "Example block scaffolded with Create Block tool." --category "widget" --dashicon "smiley" --wp-scripts --no-plugin
@allysonsouza
allysonsouza / wp-cli-commands.md
Last active July 26, 2024 18:32
[WP-CLI Commands] Useful WP-CLI commands and "recipes" #wpcli #wordpress

Multisite Search and Replace

wp config set DOMAIN_CURRENT_SITE "newdomain.com"
wp search-replace "olddomain.com" "newdomain.com" --url=newdomain --precise
wp search-replace --network "http://olddomain.com" "https://newdomain.com" --precise --all-tables

Add Super Admin

@allysonsouza
allysonsouza / plugin-show-dirname.php
Last active May 12, 2023 19:02
[Plugin Show Dirname] Display WordPress plugin directory name in plugin list view, making easier to identify plugins with same name, useful when you want to have installed multiple versions of same plugin to easily switch activation
<?php
/**
* Plugin Name: Plugin Show Dirname
* Description: Display WordPress plugin directory name in plugin list view, making easier to identify plugins with same name, useful when you want to have installed multiple versions of same plugin to easily switch activation
* Plugin URI:
* Version: 1.0
* Author: Allyson
* Author URI: https://allysonsouza.com.br
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@allysonsouza
allysonsouza / error-reporting-level.php
Last active May 24, 2023 20:23
Error Reporting Level for WordPress
<?php
/**
* Plugin Name: Error Reporting Level
* Description: Sets the error reporting level for your WordPress install. View more on: https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting
* Plugin URI:
* Version:
* Author: Allyson
* Author URI: https://allysonsouza.com.br
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@allysonsouza
allysonsouza / jet-engine-macro-current-user-email.php
Last active January 24, 2023 19:27
JetEngine Macro - Current user email
<?php
/*
Plugin Name: JetEngine Macro - Current user email
Plugin URI:
Description:
Author: Allyson Souza
Version: 1.0.0
Author URI: https://www.allysonsouza.com.br
*/
@allysonsouza
allysonsouza / command.md
Created October 27, 2022 16:32
[Bash Commands] #Linux #Ubuntu #Terminal #Bash

Bash Commands

Permissions

Change permissions of all directories

find {/var/www/...} -type d -exec chmod 755 {} \;

Change permissions of all files

find {/var/www/...} -type f -exec chmod 644 {} \;

@allysonsouza
allysonsouza / basic.md
Last active August 7, 2024 13:00
[Git Commands] Git commands #Git #snippets

Git Commands

General

Init repository

git init

Discard unstaged changes

@allysonsouza
allysonsouza / docker-snippets.md
Last active February 24, 2024 16:49
[Docker Snippets] Docker snippets that can be useful on daily basis #docker

Docker Snippets

Build image

Uses the Dockerfile to build a new image.

docker build -t [IMAGE-NAME] .

  • -t flag tags your image
  • . at end tells build to search for Dockerfile on current dir
@allysonsouza
allysonsouza / gitlab-add-board-link.js
Last active March 17, 2022 22:00
UserScript: GitLab - Add Board Link
@allysonsouza
allysonsouza / launch.json
Created September 24, 2021 20:51
[VS Code XDebug launch.json] VS Code XDebug launch.json config #vscode #xdebug
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
}
]