In JavaScript, as in many other programming languages, variables have a scope – global or local / block. Functions also have a scope, if they
Read moreEmails are not sent or do not arrive from online forms – PHP / WordPress
If you are using a cPanel based hosting account and suddenly your website stopped delivering emails from form submissions or the PHP “mail” function, open
Read moreChrome freezes or hangs in Android
A simple fix for chrome freezing (hanging) and not responding for a few seconds on an Android phone (Xiaomi or other brands): Open chrome Type
Read moreShow WordPress template file in footer
Tracing the template file used by WordPress might be tricky at times.The code below print the full path and name of the template file used
Read moreAdjusting PHP pages to work with full caching
Caching web pages speeds-up dramatically the loading time. A ready, waiting cached version is served, no load on the server, no preparation, here it is!
Read moreFixing Alexa skill regional restrictions
Suddenly, after years of usage, Alexa stops playing music from Spotify. Strange, but ok. a simple case of resetting the setup? No..Trying to disable the
Read moreDrupal ubercart log shows “cURL error: Peer’s certificate issuer has been marked as not trusted by the user.” after installing wildcard SSL certificate
Recently our shopping cart (Ubercart under Drupal) stopped finalizing transactions. The orders got up to the review step, but then, instead of completing the order,
Read moreDrupal 7 feed import incomplete or too slow
In our setup SAP exports a daily price and stock file for our website. The file is uploaded in a script via FTP to the
Read moreThe quickest way on the road to become GDPR compliant – disabling google analytics with one JavaScript line
Well, I’m not going to write the full guide to GDPR compliance yet, but pay attention to this mind blowing discovery: Google provides a way
Read moreRegex find and replace phrase starting with X and ending with Y
I needed to remove many lines from my sitemap.xml file which Google search console didn’t crawl correctly (reported as soft 404). The lines to remove
Read moreRemoving second English keyboard in Windows 10
It already happened more than once. Windows 10 updates and I find myself switching languages from English (united States) to English (my country) to my
Read moreExcel – Select and copy only filtered rows
If you have an excel with many rows and you have applied filters or even only hidden some rows you can easily select and copy
Read moreContact form 7 get value before pipe (_raw_ value equivalent)
On one of our WordPress sites we used the excellent contact form 7 plugin. The plugin allows you to easily create forms for your site.
Read moreForce download of files with specific extensions
On one of my websites I listed product drawings for customers to download. These drawings were offered in different formats: PDF, Solidworks, Parasolid, DXF and
Read moreTracking protection and JavaScript errors
A few days ago I noticed redirect issues on one of our websites. Instead of opening a new window with a download form (with window.open
Read moreMake menu items disappear as screen shrinks
Most website menus are made with some kind of a <ul> <li> structure variation. Usually they also have a mobile mode (hamburger) that comes into
Read morePrint object content in JavaScript using an “alert”
A highly readable, indented output using:
1 |
alert(JSON.stringify(OBJECT_TO_OUTPUT, null, 5)); |
Read more
Stopping YouTube video when closing an overlay (modal/popup)
Sometime you want your videos to open in a nice overlay instead of a new window. There are many solutions for that (modals in BootStrap,
Read moreMoving to HTTPS with Cloudflare
Cloudflare offers many benefits: There’s the CDN which makes your site faster to reach in different locations. There’s the caching system which makes it even
Read moreRename file extensions including files in sub directories – windows command line
Leveraging the “ren” command line inside a loop makes it easy to rename all “.html” files to “.php” including files in sub directories in one
Read morePosition a title on top of an image
Many times we want to have an image or a banner with some text on it. The most simple solution is to embed the text
Read morePHP debugging and logging using file_put_contents
There are many ways to debug code. Obviously, the most in-depth debug process is using a full blown debugger such as xDebug (more information can
Read moreReady function in JavaScript
jQuery users are happy, they have:
1 |
$( document ).ready |
If you wish to have a vanilla JavaScript solution, this is the one I’m using:
Read moreDebug / inspect dynamic JavaScript elements (slider, menu etc.) in chrome developer tools
Sometimes you want to use chrome’s developer tools to inspect an element which is changing. In my case I had a slider that was moving
Read moreAdjusting an iframe height automatically according to its content
I would always prefer to avoid using an iframe, but sometimes it is the easy / only way out of a technical mess. If the
Read moreSending user input into a database and retrieving it – when to escape and how to display
The mysql_real_escape_string() prepares input for database storage: mysql_real_escape_string() calls MySQL’s library function mysql_real_escape_string, which prepends backslashes to the following characters: \x00, \n, \r, \, ‘, ” and
Read moreGoogle site search alternative.. by Google
As so many others, my company needed an alternative for its search engine. We were using Google Site Search (GSS) for years and were happy
Read moreWindows 10 lock screen time format
I always prefer the 24 hour time format. Windows 10 was set up to my region and showed the clock in the lower right corner
Read moreFind and Replace Hyperlinks (url links) in Excel
Excel has some strange behaviors, one of them is that the “find & replace” function doesn’t work with hyperlinked content. In order to overcome
Read morePassword protect folder and subfolders using htaccess
If you wish to password protect a folder on the server and you want to use the server’s default protection do the following: We need
Read more