- CD into the theme/plugin dir:
cd /path-to-your-theme-or-plugin
- Edit .htaccess file using vi inside the docker container using this command:
wp-env run cli vi .htaccess
- Add the following line at the end of the file:
php_value upload_max_filesize "8M"
- Close the vi by pressing escape a few times and then writing this:
:wq
and hit enter.
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 | |
// Adding a custom rewrite rule | |
add_action('init', 'custom_rewrite_rule'); | |
function custom_rewrite_rule() { | |
add_rewrite_rule('^([^/]*)/?', 'index.php?page_or_city=$matches[1]', 'top'); | |
} | |
// Registering the custom query variable | |
add_filter('query_vars', 'custom_query_vars_filter'); |
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
import requests, json | |
username = "[email protected]" | |
password = "YOURPASSWORDHERE" | |
webhook = "https://yoursite.com/?shiphero-webhook=819284691" | |
shop_name = "ShopName" | |
# Authenticate | |
auth = requests.post("https://public-api.shiphero.com/auth/token", json={ | |
"username": username, |
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
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.chrome.service import Service | |
from chromedriver_py import binary_path | |
# Your WordPress credentials | |
username = "your_username" |
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
import pandas as pd | |
df = pd.read_csv('large_file.csv') | |
n = 49000 # Max number of rows you want each chunk to have | |
chunks = [df[i:i+n].copy() for i in range(0,df.shape[0],n)] | |
k = 1 | |
for chunk in chunks: | |
chunk.to_csv('data/chunk_{}.csv'.format(k), index=False) |
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
import smtplib | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
def notify(receiver_address, subject, mail_content): | |
sender_address = '[email protected]' | |
sender_pass = '16_CHARACTER_PASS_HERE' | |
message = MIMEMultipart() |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Title of the document</title> | |
</head> | |
<body> | |
<img loading="lazy" data-lazy | |
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkqAcAAIUAgUW0RjgAAAAASUVORK5CYII=" |
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
// Following the direction from https://moz.com/blog/geolocation-the-ultimate-tip-to-emulate-local-search | |
function convert_uule( $location_name ) | |
{ | |
// Code for length that resets at 64 | |
$len = strlen($location_name) % 64; | |
// uule mapping array | |
$uule_map = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'; |
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
systemctl daemon-reload | |
systemctl enable jupyter.service | |
systemctl start jupyter.service |
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
INSERT INTO | |
`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) | |
VALUES ( | |
NULL, 'rizwan', MD5('PASSWORD_HERE'), 'Riz', '[email protected]', '', NOW(), '', '0', 'Rizwan'); | |
SET @WPUserID = LAST_INSERT_ID(); |
NewerOlder