Pinakin Patel
PHP Web Developer
using imapsync on terminal
how to start a sync from terminal using the excellent imapsync
how to increase increase by a percentage and round to the nearest 5p
select pr.*, round((pr.price * 1.2), 2 ) as 'round_price_2', round( (pr.price * 1.2) / 0.05, 0) * 0.05 as 'new_price_2_05' from xcart_pricing as pr where pr.membershipid = 0 use round( (pr.price * 1.2) / 0.05, 0) * 0.05 to round to the nearest 5p update xcart_pricing...
Command to show the top ten file requests from an apache log file
You can use a combination of terminal commands like awk, sort, uniq, and cut to analyze an Apache log file and find out which files are called the most and the bandwidth they are using.
Function to create a slug in MySQL
Use this to create a slug from a string field.
using curl to fetch a file using sftp with password in command
If you need to download a file using SFTP from the command line, you should use the sftp or scp commands.
updating custom field values in mailwizz using direct SQL
In mailwizz you can create custom fields which get assigned a field_id in the database table. So in my case the customer field is called rank and the field_id = 24.
Format Telephone numbers into US format in MySQL
if you have a telephone field in a table where numbers have been entered in the format 1234567890 then use this to format it as 123-456-7890
Adding a product level field which is language dependent
Use this guide to add a new field to the xcart_products_lng_en table.
Driving School Price Comparison using wpDataTables
How to create a searchable and sortable data table in wordpress using wpDataTables Lite Plugin. I have chosen this plugin as the lite version can fetch data from a publicly hosted CSV file. As part of this setup I have created a database table with columns company,...
Reading a CSV and calling ChatGPT and outputting to a New CSV file
In this example I am going to use python to read a CSV with 1 column headed 'country' and then for each country in the file it will write a new CSV file with the information returned from ChatGPT3 to create a country and description CSV file. file1.csv should be kept...
jQuery to check the first charater of a link started with hash #
I came across an issue with an old wordpress site where the mobile menu did not close when a menu item link to internal page content because the url started with # hash.
Guide to Changing Directory Permissions to 755 and File Permissions to 644
Tutorial on how to change the permissions of all files and directories within a directory tree on Linux
Adding a HTML Sitemap to a Shopify Store
I have found that themes generally use links to prodct pages that are not the canonicalised url to the product on the store page. So this is to allow the breadcrumb to be dynamic and show based on the route they took to the product page.
How to get the sending IP addresses from the references in your SPF record
If you use SMTP services like Mailjet or Amazon then your email could be sent from multiple possible IP addresses. An easy way to identifiy these ip addresses is by looking at the SPF record. This is easily done using googles dig tool...
Using aspect Ratio in CSS
Aspect Ratio in CSS refers to the proportional relationship between the width and height of an element. It represents the ratio of the element's width to its height. For example, an element with an aspect ratio of 16:9 would have a width that is 16 times larger than...
Resetting your wordpress password using SQL
https://www.domain.com/help/article/wordpress-how-to-change-or-reset-your-admin-passwordhttps://www.domain.com/help/article/wordpress-how-to-change-or-reset-your-admin-password
Installing and using ApacheTop on centos
You can check if epel-release is installed on CentOS by running the following command in the terminal: rpm -qa | grep epel-release This will check if the epel-release package is installed and will display the package name if it is installed. If the package is not...
Create a link to Google Search Console for ranking data
In this example I am going to create a link to google search console to get history of keywords used and organic position in the last 3 months for a url in your xcart 4 store from the backend. In order to do this you must have your domain verified and setup in google...
How to use Open AI for your Marketing and Website content and product descriptions
In this video I use OpenAI to write product descriptions or meta data using a product name and bullet point of features. Also explain how to use this to rephrase text if you already have something to work from
Adding your own custom css file to shopify store
When working with shopify you will want to edit the css file for yours store theme. Editing the css file is not recommended as you will come into issues with theme updates which either remove your updates or change so much that you had not idea what your original...
Using XPath custom extractions in Screaming Frog to get store category and product ids
https://builtvisible.com/seo-guide-to-xpath/
How to create lighthouse reports in batch using linux and chrome cli headless
Learn how to run lighthouse reports using chrome headless using a linux laptop.
Creating a timelapse video from gopro timelapse images using ffmpeg
Creating thumbnails from video files
How to Create a CSS Grid Layout for Divi Modules
For those already familiar with building websites in Divi, creating custom grid layouts is a core aspect of the Divi Builder.