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
Effects – Animate On Scroll (AOS), ColorBox, Responsive Tabs
A great library for animating object appearance when scrolling to them: https://github.com/michalsnik/aos Important note – if the page has changed in its length (i.e. opening/closing
Read moreStopping 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 moreMoving any website from HTTP to HTTPS – securing your site for visitors while improving SEO
For WordPress and Drupal specific instructions please visit Moving WordPress website to HTTPS and Moving Drupal website to HTTPS Technical: Buy and install a SSL
Read moreMoving Drupal website to HTTPS – securing your site for visitors while improving SEO
Technical: Buy and install a SSL certificate Backup database and files Try to change all absolute references to relative, or change all hard-coded “http://www.yoursite.com…” into
Read moreGet Drupal to show you missing string for translation
I had a hard coded string that I wanted to translated so I wrapped it with <?php print t(‘MyString’); ?> Next I wanted to add translations
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 moreCSS hover on one element to affect another (sibling or child)
This is possible to trigger css rules for an hover on one element that will affect another. One example for this is hovering over a
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 moreMoving WordPress website to HTTPS – securing your site for visitors while improving SEO
Technical: Buy and install a SSL certificate Backup database and files Try to change all absolute references to relative, or change all hard-coded “http://www.yoursite.com…” into
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 morePassing a variable reference to a function using “&”
When calling a function with parameters, the variables in the parameters are copied/cloned in the function and use their new names. This way you can
Read moreDrupal – linking elements in a view to their content (node)
When creating a view there is an option for the title to link to the content: check box with “Link this field to the original
Read morePHP heredoc syntax <<<
Sometimes you need to use long strings (usually HTML code) in variable assignment or simply to echo them. There are several options to delimit string,
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 moreWordPress update dates for all posts
I have a site I started but never officially launched. It has many posts and as time passes by they are getting old. Every once
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 moreRun one time PHP code on Drupal
Many times while searching for solutions for my Drupal problems I see snippets of code that do various things. How do I run them? There
Read moreGetting the visitor’s IP behind a CDN
Recently we installed a WAF (web application firewall) which comes with a CDN setup. The CDN is basically a proxy that all traffic to our
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 morehtaccess Redirect only exact url match
I use a lot of redirecting, a result of site evolution over time – moving from one CMS to another, having multiple languages on my
Read moreRemove video suggestions + movie title from embedded YouTube video / playlist
Apparently YouTube embed code has optional parameters that allow you to hide the suggested videos that pop while pausing or at the end of the
Read moreUp and running with SASS and Compass
Install ruby using an installer downloaded from their website. Install Sass: “gem install sass” in the command prompt (cmd). install compass “gem install compass” in the
Read more