Firefox 89-100 (2022) Tabs on top/bottom not working fixed again
NEW UPDATE MAY 2023 – FIREFOX 113 https://www.codehaven.co.uk/firefox/firefox-113-2023-tabs-on-top-bottom-not-working-fixed-again/ The following version Works with Firefox version 100 – May 2022 onwards Make the Browser Tabs appear at the Top You use the tabs far much more than the URL bar, so it makes sense, and saves many miles on your mouse. Put the tabs nearer, […]
Flip Div using Css3
When hovering over an image it will use the CSS to implement an image flip.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
<div id="f1_container"> <div id="f1_card" class="shadow"> <div class="front face"> <img src="http://www.lolcats.com/images/u/07/32/lolcatsdotcomclu5vrpst727hzii.jpg"/> </div> <div class="back face center"> <img src="http://www.lolsnaps.org/wp-content/uploads/2012/07/funny-cat-relax.jpg"> </div> </div> </div> #f1_container { position: relative; margin: 10px auto; width: 450px; height: 330px; z-index: 1; } #f1_container { perspective: 1000; } #f1_card { width: 100%; height: 100%; transform-style: preserve-3d; transition: all 1.0s linear; } #f1_container:hover #f1_card { transform: rotateY(180deg); box-shadow: -5px 5px 5px #aaa; } .face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; } .face.back { display: block; transform: rotateY(180deg); box-sizing: border-box; padding: 10px; color: white; text-align: center; background-color: #aaa; } |
Firefox 113 (2023) Tabs on top/bottom not working fixed again
Again they have updated Firefox and screwed up the changes made last time to keep the tabs underneath the url. Fortunately its a quick fix. Search your userChrome.css for the following two lines and replace. 1. Replace
1 2 3 |
-moz-box-ordinal-group: 2; |
With
1 2 3 |
order: 2; |
2. Replace
1 2 3 |
-moz-box-orient: vertical |
With
1 2 3 |
flex-direction: column; |
Close Firefox, and restart. Thanks to u/hasaan5 (reddit for that) […]
Only accept numbers less than 100 for textbox – Jquery
1 2 3 4 5 6 7 8 |
$('#numberbox').keyup(function(){ if ($(this).val() > 100){ alert("No numbers above 100"); $(this).val('100'); } }); |
Percentage
To find 30% of a variable
1 2 3 4 5 6 |
// $budget = 100; $thirtypercent = ($budget * 30 /100); //$thirtypercent will equal 30 |
Most of the time is *100, but here it is…..
1 2 3 4 5 6 7 |
$x = 3; $y = 15; $percent = $x/$y; $percent_friendly = number_format( $percent * 100, 2 ) . '%'; |
Redirect WordPress if url contains a specific directory
This can be a tricky one! Redirecting using .htaccess can be hit and miss at the best of times. If you want to redirect any url that contains a specific text without wordpress then that code snippet is here. But add to that the nature of WordPress and cache it can be a nightmare. But […]
How to Solve the Worlds Problems – In a Day!
Interesting Maths I have been doing some maths and found the following interesting…. Billionaires that give away their money within their lifetime, they sign up to a Pledge. ‘Pledgers’ to commit to giving away at least half their fortunes during their lifetimes or upon their deaths. The Giving Pledge, was begun by Warren Buffett and […]
How Google Search Ranking Works – Darwinism in Search – Search Engine Journal
Are featured snippets are driven by a specific ranking algorithm that is separate from the core algorithm? That’s my theory. For me, the idea holds (a lot) of water. And I’m not alone. Experts such as Eric Enge, Cindy Krum, and Hannah Thorpe have the same idea. To try to get confirmation or a rebuttal […]
Make a Footer Stick to the Bottom of the Page
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
* { margin: 0; } html, body { height: 100%; } .stickywrapper { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -4em; } .stickyfooter, .push { height: 4em; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<html> <head> <link rel="stylesheet" href="layout.css" ... /> </head> <body> <div class="stickywrapper"> <p>Your website content here.</p> <div class="push"></div> </div> <div class="stickyfooter"> <p>Copyright (c) 2008</p> </div> </body> </html> |
How to Enable and Use Coupons in WooCommerce
1. To enable Coupons find the “Enable the use of coupon codes” (It can be in different places depending on the versions of WooCommerce you have) 2. Refresh your page and you will see that Coupons have been added to the menu 3. You will then see a welcome page to coupons […]
Create a plugin with shortcode for Elementor – Most basic ever!
1. Save this code below as rawcode.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?php /** * Plugin Name: Rawcode Wodpress Plugin demo * Plugin URI: http://aq.gthex.co.uk:10000 * Description: Display content using a shortcode to insert in a page or post * Version: 0.1 * Text Domain: rawcode-wordpress-plugin-demo * Author: mike * Author URI: http://aq.gthex.co.uk:10000 */ function rawcode_wordpress_plugin_demo($atts) { echo "<h1>hello this is the rawcode plugin demo</h1>"; } add_shortcode('rawcode-plugin-demo', 'rawcode_wordpress_plugin_demo'); |
2. Create a folder in the plugins folder called the same – “rawcode” (\wp-content\plugins\rawcode) 3. This will now show up as a plugin. Activate it. 4. In a page or post within elementor (or without) add the following shortcode. [rawcode-plugin-demo] 5. It will now appear in the […]
Responsive Video for YouTube
This will make your youtube video fully responsive….
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<div class="videoWrapper"> <iframe width="560" height="349" src="http://www.youtube.com/embed/XXXXXXXXXXXX?rel=0&hd=1" frameborder="0" allowfullscreen></iframe> </div> .videoWrapper { position: relative; padding-bottom: 56.25%; /* 16:9 */ padding-top: 25px; height: 0; } .videoWrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } |
Make Iframe with Javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<html> <head> <script language="JavaScript" type="text/javascript"> function makeFrame() { ifrm = document.createElement("IFRAME"); ifrm.setAttribute("src", "http://aq.gthex.co.uk:10000/"); ifrm.style.width = 640+"px"; ifrm.style.height = 480+"px"; document.body.appendChild(ifrm); } </script> </head> <body> <p><a href="#" onMouseDown="makeFrame()">GO! </a></p> </body> </html> |
To make it append to a div called container (id) use this
1 2 3 4 5 6 7 8 9 10 11 |
function makeFrame() { ifrm = document.createElement("IFRAME"); ifrm.setAttribute("src", "http://aq.gthex.co.uk:10000/"); ifrm.style.width = 100+"%"; ifrm.style.height = 100+"%"; // document.body.appendChild(ifrm); var objTo = document.getElementById('container') objTo.appendChild(ifrm); } |
And here we have an iframe that can switch between replacing the contents each time
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
<html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script language="JavaScript" type="text/javascript"> function makeFrametoday() { $('.cat').hide(); ifrm = document.createElement("IFRAME"); ifrm.setAttribute("src", "http://aq.gthex.co.uk:10000/"); ifrm.setAttribute("class", "dog"); ifrm.style.width = 60+"%"; ifrm.style.height = 60+"%"; var objTo = document.getElementById('today') document.body.appendChild(ifrm); } function makeFrameyesterday() { $('.dog').hide(); ifrm = document.createElement("IFRAME"); ifrm.setAttribute("src", "http://www.bing.co.uk/"); ifrm.setAttribute("class", "cat"); ifrm.style.width = 60+"%"; ifrm.style.height = 60+"%"; var objTo = document.getElementById('yesterday') document.body.appendChild(ifrm); } </script> </head> <body> <div id="today"></div> <div id="yesterday"></div> <p><a href="#" onMouseDown="makeFrametoday()">GO! </a></p> <p><a href="#" onMouseDown="makeFrameyesterday()">GO! </a></p> </body> </html> |
If you need to remove iframe border then
1 2 3 |
ifrm.frameBorder = 0; |
Center text in middle of page
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
.savedtext { left: 0; line-height: 200px; margin: auto; margin-top: -100px; position: absolute; top: 50%; width: 100%; text-align: center; font-size: 4em; color: green; } |
Anchor position going to far down the page
If your anchor goes to far down the page, use this code it does not affect anything other than the actual position of where the anchor stops. If you have an anchor id of ‘latest’ so you click on it /mysite/#latest as the link the ID is labelled as ‘latest’ and add this css below. […]
Gradient Background
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
html { height: 100%; } body { height: 100%; margin: 0; background-repeat: no-repeat; background-attachment: fixed; background: blue; /* For browsers that do not support gradients */ background: -webkit-linear-gradient(left, #0C7CD0 , #5ABDF4); background: -o-linear-gradient(right,#0C7CD0, #5ABDF4); background: -moz-linear-gradient(right, #0C7CD0, #5ABDF4); background: linear-gradient(to right, #0C7CD0 , #5ABDF4); } |
Delete the oldest records first – MySql
This deletes the first 1000 records in order by ID
1 2 3 |
DELETE FROM table1 ORDER BY id ASC limit 1000 |
Google Says You Are Not Entitled to Links – Search Engine Journal
A recent exchange on Twitter between Rand Fishkin and Google’s Danny Sullivan highlighted the tension between Google and the SEO community regarding links. This time it was over the idea of links to sources that are quoted by websites like news organizations. Are sources quoted by news organizations and other sites entitled to a do-follow […]
What does ‘background-size’ do in CSS?
Some ways of using an image in a background.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
.stretch{ /* Will stretch to specified width/height */ background-size: 200px 150px; } .stretch-content{ /* Will stretch to width/height of element */ background-size: 100% 100%; } .resize-width{ /* width: 150px, height: auto to retain aspect ratio */ background-size: 150px Auto; } .resize-height{ /* height: 150px, width: auto to retain aspect ratio */ background-size: Auto 150px; } .resize-fill-and-clip{ /* Resize to fill and retain aspect ratio. Will cause clipping if aspect ratio of box is different from image. */ background-size: cover; } .resize-best-fit{ /* Resize to best fit and retain aspect ratio. Will cause gap if aspect ratio of box is different from image. */ background-size: contain; } |
Best Plugins to Compress Images for SEO
WP image compression plugins, have always been hit and miss. Here I try to show you how to get the best SEO results for your website and what combination of plugins you should use. EWWW Image Optimizer plugin has always been my tool to cope with importing large images and compressing them. Sometimes I export […]
How to Fix Blurry Gallery Thumbnails in Woocommerce
I had some really blurry gallery thumbnails in Woocommerce, using the Hello theme with Elementor. The images uploaded were of very high quality and so I read a few blog posts and found out about “Regenerate Thumbnails” plugin. So I thought I would give it a go. I installed then regenerated the thumbnails, and it […]
Fly to Cart effect
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
$('.add-to-cart').on('click', function () { var cart = $('.shopping-cart'); var imgtodrag = $(this).parent('.item').find("img").eq(0); if (imgtodrag) { var imgclone = imgtodrag.clone() .offset({ top: imgtodrag.offset().top, left: imgtodrag.offset().left }) .css({ 'opacity': '0.5', 'position': 'absolute', 'height': '150px', 'width': '150px', 'z-index': '100' }) .appendTo($('body')) .animate({ 'top': cart.offset().top + 10, 'left': cart.offset().left + 10, 'width': 75, 'height': 75 }, 1000, 'easeInOutExpo'); setTimeout(function () { cart.effect("shake", { times: 2 }, 200); }, 1500); imgclone.animate({ 'width': 0, 'height': 0 }, function () { $(this).detach() }); } }); |
Amazon Reviews can’t be trusted – Thousands of fake reviews found
Amazon Fake Reviews When I ordered a mobile phone screen protector for my Samsung S8 plus, I fired up the Amazon app and started to search for a well made, good fitting and most importantly a product that has top reviews. Now what if I told you that thousands upon thousands of reviews are fake. […]
Increase Maximum Execution time of 60 seconds in PHP
Very simple this one… Just add the code below and it will change that pages maximum execution time to 100 seconds…..
1 2 3 4 5 6 |
<?php set_time_limit(100); ?> |
Switch / Swap/ Change Class or ID
1 2 3 |
$( "#submitboard" ).switchClass( "#submitboard", "submitboardnew", 1000 ); |
I changed the id called ‘touser’ to ‘dogs’ below
1 2 3 |
$('#touser').attr('id','dogs'); |
This changes the id of submit board to the class of submitboardnew. You can use id or class in this example.
You Want Google To Stay Stagnant & Not Improve? – Search Engine Roundtable
As you know, Google is making efforts to update their GoogleBot to crawl the more modern web. We reported it about it last week. But that bothered at least one SEO who complained that they worked on all these workarounds and now Google is going to ditch those workaround when this new GoogleBot goes live. […]
Danny Sullivan Presents Webmaster & SEO Complaints At Google Ranking Fair – Search Engine Roundtable
Danny Sullivan who is now at Google told us about these ranking fairs, where Googlers can show off ideas and features around Google search. Danny did his own this week and shared in his station many of the ongoing SEO and webmaster complaints and concerns around Google search. He did it in a creative way […]
Cars.com vs. CarGurus.com saga shows the importance of SEO (and the bad side of a Google update) – Search Engine Land
For Cars.com, the popular automotive marketplace, the March 2019 core update was good: the company has seen a 49% increase in search visibility since. SEO Director David Greene said he believes a lot of the success has to do with their SEO strategy around content and site performance updates, but there was another factor at play. While […]
Canonicals – What the hell are they?
In a nutshell a canonical is used to tell Google where you got the content from originally. Imagine you had to do an essay, and when you handed that long 2000 word essay in – most of the work was Jeff’s. The tutor would mark you down nearly 100% and tell you off. this is […]
NEW Google Indexing Issue Ongoing Friday May 24 – Search Engine Journal
Late Thursday May 23, 2019, Google’s Webmasters Twitter account tweeted that Google is suffering a new indexing problem that is completely separate from the previous day’s indexing issue. Here is the text of the tweet: We’re looking into a new indexing issue that started escalating 6 hours ago. The issue is unrelated to yesterday’s outage […]
Redirect url that contains specific text or directory – .htaccess
This is not for WordPress! If you want a way of redirecting if a url contains a directory then take a look here. If my website had a directory called dogs (/dogs/) in the URL, and I had 100 pages like this: – http://aq.gthex.co.uk:10000/dogs/page1/ http://aq.gthex.co.uk:10000/dogs/page2/ http://aq.gthex.co.uk:10000/dogs/page3/ I would not want to use a plugin to […]
Trim left Javascript text
Simple way to trim whitespace for the beginning of text using JavaScript.
1 2 3 4 |
var keywordvalue = " Hi "; var keywordvalue = (keywordvalue.trimLeft()); |
Output = “Hi ” To replace all whitespace using Javascript use this next script. http://aq.gthex.co.uk:10000/javascript/trim-whitespace-javascript/
Passive Earning – Hi Dollars Crypto App
earn Passive income with the hi Dollars App Start earning now Invite only ‘hi Dollars’ – Start earning passive income £25 P/M for clicking a button This simple app is a great starter for those who want to start into the cryptocurrency world without actually having to use any money. You can earn money by […]
Sticky header – Logo smaller and adds border on scroll
This is purely code just to apply a logo shrink on scroll and also applies a border on the bottom of the header using elementor. Make sure you add the id of the logo to #mylogo, and the header section add the ID of #myheader. Then add the code below to the section css in […]
Vary: User-Agent in WordPress – SEO
When performing a gtmetrix test (gtmetrix) you may see a problem under the Vary: Accept-Encoding area. There are a few ways to fix this, firstly you can use Cloudflare(CDN) that does it automatically. Another way of solving this is adding it to you .htaccess file directly or adding it to your functions.php file if your […]
Random numbers and string
Just numbers
1 2 3 |
echo mt_rand (10,1000000); |
and both numbers and letters
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function generateRandomString($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomstring; } echo generateRandomString(); |
DNS settings – Cloudflare, OpendDns and Google
What are some popular DNS options besides my ISP’s default? Google Public DNS: Primary: 8.8.8.8 Secondary: 8.8.4.4 OpenDNS Primary: 208.67.222.222 Secondary: 208.67.220.220 Cloudflare Primary: 1.1.1.1 Secondary: 1.0.0.1 Maybe you want to Add Dynamic DNS to your Router with FreeDNS
replacewith – change div onclick
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <div class="changeme">1000</div> <script> $(".changeme").click(function() { var thevalue = $( this ).text(); $(this).replaceWith($('<input type=text>').attr({ id: 'name', value: $(this).text() })); }); </script> <style> div { color: red; border: 2px solid blue; width: 200px; margin: 3px; text-align: center; } </style> |
Text file Read – Create – Save write/delete fopen
Read text file
1 2 3 4 5 6 7 |
<?php $myfile = fopen("webdictionary.txt", "r") or die("Unable to open file!"); echo fread($myfile,filesize("webdictionary.txt")); fclose($myfile); ?> |
Create a text file and add 122 to the file and save it
1 2 3 4 5 6 |
$myfile = fopen("newfile.txt", "w") or die("Unable to open file!"); $txt = "122"; fwrite($myfile, $txt); fclose($myfile); |
Basic write to text file
1 2 3 4 5 6 7 |
$myname = "This will be added to text file"; $handle = fopen('mytextfile.php','a+'); fwrite ($handle,$myname); fclose($handle); echo "Text file written"; |
New file name Creates a new file with the milliseconds time (Filenumber-1232233223.txt)
1 2 3 4 5 6 |
$date_to_add=substr(microtime(true) * 1000, 0, 13); $handle = fopen('C:\Projects\dev\Filenumber-'.$date_to_add.'.txt','a'); fwrite ($handle,$writethis); fclose($handle); |
When run, this creates a text file (you may need permissions to write), the ‘a’ stands for append […]
Show only 2 decimal places
Two ways of doing this…be careful…. Best way ..
1 2 3 4 5 6 7 |
<?php $number = 123; $txt = sprintf("%1.2f",$number); echo $txt; ?> |
This now shows 123.00 (it has added two decimal places as zeros, to make up the number) Second way …. (not as good, as it rounds up to 2 decimal places)
1 2 3 4 5 6 |
<?php $predicted = 23.1234; round($predicted, 2); ?> |
This will show 23.12 (and can be added to another number) But…..if the […]