Add a global rel=”noopener noreferrer” with jQuery

Add this jQuery script globally to add a rel=”noopener noreferrer” attribute to all your target=”_blank” links. Ok so, you may have a lot of pages with lots of links, maybe over 100 pages with links going all over the web. And you don’t feel like going through all the pages and checking and double checking…

Read More

Useful JS Libraries

Graphs Chart.js – Vis.js – 3D.js – WebGL Pixi.js – Directories Jquery File Tree – dim noExt, noExtResult ‘ ASP remove file extension noExt = InStrRev(i__Name, “.”, -1, 1) If ( noExt > 0 ) then noExtResult = Mid(i__Name, 1, noExt – 1) End If i__Ext = LCase(Mid(i__Name, InStrRev(i__Name, “.”,…

Read More

Pixels to REM, REM to pixels calculator

Here’s a simple pixel to rem, rem to pixel calculator using ReactJs. How to use it? In most cases, 2018 and after, 16px is the norm for default pixel sizes. Just type in the pixel in the px field and it will give you the REM equivalent, and vice versa.

Auto Redirect to another page

Here’s are the simplest ways to auto redirect from one webpage to another. META Refresh meta http-equiv=”refresh” content=”0;url=YOUR-URL.COM” Javascript // will overwrite history window.location.replace(‘YOUR-URL.COM’); // will add to history window.location.assign(‘YOUR-URL.COM’); Jquery $(location).attr(‘href’, ‘YOUR-URL.COM’)

Simple DIY Web Stats

Now, there’s a lot of web stats 3rd party plugins out there. Google analytics is awesome tool to keep track of your web stats. Statcounter is another tool to keep track of site. However all those information are kept on their website and not yours. Although, you can download the logs, those 3rd party website…

Read More

Fix WordPress CORS Policy

I’ve had this error come up. “… has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.” To fix it, add this code to your .htaccess file: <FilesMatch “.(php|ttf|ttc|otf|eot|woff|woff2|font.css)$”> <IfModule mod_headers.c> Header set Access-Control-Allow-Origin “*” </IfModule> </FilesMatch>

Woocommerce – Delete Add to Cart

Add this code: remove_action(‘woocommerce_single_product_summary’,’woocommerce_template_single_add_to_cart’, 30 ); To your Functions.php file.

mysql Putty Commands

Log onto mysql: mysql -p mysql -u root -p Create a database: mysql> create database [database name]; Show all databases: mysql> show databases; Select database: mysql> use [database name] Show your database tables: mysql> show tables; Find database directory: mysql> select @@datadir; Create user: mysql> grant all privileges on [database name].* to ‘[username]’@’localhost’ identified by…

Read More

Common WordPress Problem Fixes

Permalinks to ‘Postname’ cause Page Not Found To fix, find your Apache httpd.conf file. Look for the code: LoadModule rewrite_module modules / If there a # (comment out) in front of the code above, remove the #. Save and restart your server.

Useful Putty Commands

Navigate directories: cd .. cd [FOLDERPATH]/ Change owner of a file/folder: chown [USERNAME] [FILENAME] chown [USERNAME] -R [FOLDERNAME] Move a file: mv [FILENAME].ext [NEWDIRECTORY]/ Move a directory: mv [FOLDERNAME]/ [NEWDIRECTORY]/ Change File/Folder Permissions: chmod 755 [filename].ext Change Permission for all files/folder in current folder: chmod -R 755 Compress folder to download: tar cvfz [OUTPUTNAME].tar.gz [FOLDERNAME]/…

Read More