This file contains hidden or 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 | |
add_action( 'wp_dashboard_setup', 'iv_wp_dashboard_setup' ); | |
function iv_wp_dashboard_setup() { | |
if( current_user_can( 'install_plugins' ) ) | |
wp_add_dashboard_widget( 'iv_folder_sizes', __( 'Folder Sizes' ), 'iv_wp_add_dashboard_widget' ); | |
} | |
function iv_wp_add_dashboard_widget() { | |
$upload_dir = wp_upload_dir(); |
This file contains hidden or 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
UPDATE TABLE_NAME SET COLUMN = REPLACE(COLUMN,'Š','S'); | |
UPDATE TABLE_NAME SET COLUMN = REPLACE(COLUMN,'š','s'); | |
UPDATE TABLE_NAME SET COLUMN = REPLACE(COLUMN,'Ð','Dj'); | |
UPDATE TABLE_NAME SET COLUMN = REPLACE(COLUMN,'Ž','Z'); | |
UPDATE TABLE_NAME SET COLUMN = REPLACE(COLUMN,'ž','z'); | |
UPDATE TABLE_NAME SET COLUMN = REPLACE(COLUMN,'À','A'); | |
UPDATE TABLE_NAME SET COLUMN = REPLACE(COLUMN,'Á','A'); | |
UPDATE TABLE_NAME SET COLUMN = REPLACE(COLUMN,'Â','A'); | |
UPDATE TABLE_NAME SET COLUMN = REPLACE(COLUMN,'Ã','A'); | |
UPDATE TABLE_NAME SET COLUMN = REPLACE(COLUMN,'Ä','A'); |
This file contains hidden or 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
SET | |
@search := 'https://website.com/wp-content/uploads/2019/10/the_original_image.jpg'; | |
--COLLATE utf8mb4_unicode_520_ci; | |
SET | |
@replace := 'https://website.com/wp-content/uploads/2019/10/the_new_image.jpg'; | |
--COLLATE utf8mb4_unicode_520_ci; | |
UPDATE | |
wp_postmeta |
This file contains hidden or 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
let data = []; | |
$('[id^=form_19]').each((i, e) => { | |
let elm = $(e).find('> form'); | |
data.push(elm.data('formId')) | |
}); | |
copy(data); |
This file contains hidden or 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
while read -r url name ; do | |
wget -O $name $url | |
done < images.txt |
This file contains hidden or 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 | |
define( 'WP_DEBUG', true ); | |
define( 'WP_DEBUG_LOG', true ); | |
define( 'WP_DEBUG_DISPLAY', false ); | |
// Logs the nmae of the function | |
error_log( '>>> IN ' . __FUNCTION__ ); |
This file contains hidden or 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
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}", | |
"initialCols": 120, | |
"initialRows": 30, | |
"copyOnSelect": true, | |
"profiles": { | |
"defaults": { | |
"acrylicOpacity": 0.85, | |
"cursorColor": "#CCC", |
This file contains hidden or 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
REM WSL symlink guide here https://dev.to/themartes_/how-to-make-wsl2-even-faster-with-fast-git-28p8 | |
REM --------------------- | |
REM Now when we have our script we need to run it every time we boot into our machine. We also need to do that with the highest privileges because you need to be an admin to make a symlink from network drive to your base drive. | |
REM So go ahead and search for Task Scheduler. On the left sidebar you will see Task Scheduler Library. Click on it and on the right sidebar click on Create Task.... | |
REM Now make sure you'll give a name to your task, then write a little description and Check "Run with highest privileges". Also make sure you'll change Configure for: To Windows10 | |
REM Next click on Triggers tab and add new trigger. This will look fairly simple, Just make sure it's like this, and click OK. | |
REM Next click on Actions add New and Select the .bat script we created earlier with the following code: | |
REM --------------------- | |
@echo off |
This file contains hidden or 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
# Create secure key | |
ssh-keygen -t rsa -b 4096 -C "key_identifier" | |
# Upload key to server | |
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected] |
This file contains hidden or 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
dotenv () { | |
set -a | |
[ -f .env ] && . .env | |
set +a | |
} | |
dotenv |