Teaser Slider

28th August 2025 JavaScript and jQuery 6 comments

I have been looking for a while for a teaser slide the could do the following:

  1. Simple slider functionality.
  2. An option to tease for the next slide by small image within each slide.

All I found are normal slides that display a part of next slide. But what if I need to just promote with a small image, that not a must to be a part of next slide, while it’s like an Ad for it only.

That’s why I made this slider from scratch.

Here’s the Git Repository:

Teaser Slider Repository

Here’s the one page code, and your images should be inside ‘slides’ folder or whatever you want 😉

<!DOCTYPE html>
<html>
<head>
    <title>CairoCode Slider</title>
    <style>
        /*-CairoCoder Slide-*/
        .cc-wrapper {
            width: 960px;
            max-height: 495px;
            overflow: hidden;
            position: relative;
        }
        .cc-slide {
            display: none;
        }
        .cc-slide.cc-active {
            display: block;
        }
        .slide {
            width: 100%;
            float: left;
            height: auto;
        }
        .teaser {
            float: left;
            max-height: 100%;
            position: absolute;
            top: 0;
            right: -15%;
            opacity: 0.8;
            cursor: pointer;
            border-radius: 5px 0 0 5px;
            transition-timing-function: ease-in;
            transition: 0.25s;
        }
        .teaser:hover {
            right: 0;
            opacity: 1;
            transition-timing-function: ease-out;
            transition: 0.25s;
        }
    </style>
</head>
<body>
<div class="cc-slider">
    <ul class="cc-wrapper">
        <li class="cc-slide cc-active">
            <img class="slide" src="slides/slide1.png" alt="slide1">
            <img class="teaser" src="slides/teaser1.png" alt="teaser1">
        </li>
        <li class="cc-slide">
            <img class="slide" src="slides/slide2.png" alt="slide2">
            <img class="teaser" src="slides/teaser2.png" alt="teaser2">
        </li>
    </ul>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
        integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
        crossorigin="anonymous"></script>
<script>
    $('.teaser').click(function () {
        var next = $(this).parent().next('.cc-slide');
        $(this).parent().hide();
        if (next.length > 0) {
            next.show();
        } else {
            $('.cc-slide').hide().first().show();
        }
    });
</script>
</body>
</html>

How to shorten (terminal) command line (bash) prompt (hide computer name and user name) for Mac users and Linux

28th August 2025 Uncategorised No comments

Mac’s display name and username occupy space on the command line. some users who are working regularly on terminal may be disturbed by how long the computer name and username appears on the terminal line, here’s how to hide them.

Open Terminal, then go to Terminal menu > Preferences > Shell then select “Run command:” and write the following command:

PS1=”\w\$”;clear;

And here we go, no more computer name and username 🙂

 

Buttons should not have a “hand cursor” !

28th August 2025 UI No comments

han cursor

The hand cursor is for links

The hand (and often underlined text) signifies a link. Links are not buttons. Links came along with the web. To help users understand that they are different, they are given the hand cursor. It serves as an extra clue. Here’s why:

  1. Clicking a link opens a web page or resource.
  2. (On desktop) I can right-click on a link and do many things (that I can’t do with a button). Open in new tab/window, save a link, copy address, add to reading list, bookmark it and more.
  3. (On mobile devices) I can tap and hold on a link and get a similar context menu as per the previous point.
  4. A link also tells me that I am just going somewhere else. I am not modifying any data or making changes in anyway (like a button is likely to do).

When a button has the hand cursor, it subtly suggests that the user is interacting with a link when they’re not. If you want to give visual feedback when the user hovers, you can do so with other style changes such as background colour. A well-designed button does not need a hand cursor to help the user realise it does something.

The hand cursor is reserved for links. This is because they are unique in their behaviour. Browsers and Operating Systems have done the work for you — because contrary to popular belief — browsers know best.

Links have always been handled this way since the web came along — this is the convention of the web that you need not innovate on. You can rest easy knowing that browsers have you covered. This leaves you and your team to solve real problems.

Microsoft’s design guides talk about weak affordance:

Text and graphics links use a hand […] pointer […] because of their weak affordance. While links may have other visual clues to indicate that they are links (such as underlines and special placement), displaying the hand pointer on hover is the definitive indication of a link.

To avoid confusion, it is imperative not to use the hand pointer for other purposes. For example, command buttons already have a strong affordance, so they don’t need a hand pointer. The hand pointer must mean “this target is a link” and nothing else.

Apple’s Human Interface Guidelines states that the hand cursor should be used when “the content is a URL link”. W3C User Interface guidelines says the same thing again with “The cursor is a pointer that indicates a link”.

Reference:
Buttons shouldn’t have a hand cursor

Get data from specific table within past x of months

28th August 2025 MySQL No comments

Here’s how to get data from specific table within past 20 months of current data.

The problem is that you need to get exactly the start of first month in the same period in the criteria you specified. in below MySQL query, you can achieve that easily.

SELECT * FROM `table`
WHERE `date` BETWEEN DATE_SUB(DATE_SUB(CURDATE(), INTERVAL 20 MONTH), INTERVAL DAY(DATE_SUB(CURDATE(), INTERVAL 20 MONTH)) -1 DAY) AND CURDATE()

Prevent CSS and JavaScript files caching !

28th August 2025 JavaScript and jQuery No comments

Simple Client-side Technique

In general, caching is good.. So there are a couple of techniques, depending on whether you’re fixing the problem for yourself as you develop a website, or whether you’re trying to control cache in a production environment.

General visitors to your website won’t have the same experience that you’re having when you’re developing the site. Since the average visitor comes to the site less frequently (maybe only a few times each month, unless you’re a Google or hi5 Networks), then they are less likely to have your files in cache, and that may be enough. If you want to force a new version into the browser, you can always add a query string to the request, and bump up the version number when you make major changes:

<script src="/myJavascript.js?version=4"></script>

This will ensure that everyone gets the new file. It works because the browser looks at the URL of the file to determine whether it has a copy in cache. If your server isn’t set up to do anything with the query string, it will be ignored, but the name will look like a new file to the browser.

On the other hand, if you’re developing a website, you don’t want to change the version number every time you save a change to your development version. That would be tedious.

So while you’re developing your site, a good trick would be to automatically generate a query string parameter:

<!-- Development version: -->
<script>document.write('<script src="/myJavascript.js?dev=' + Math.floor(Math.random() * 100) + '"\><\/script>');</script>

Adding a query string to the request is a good way to version a resource, but for a simple website this may be unnecessary. And remember, caching is a good thing.

It’s also worth noting that the browser isn’t necessarily stingy about keeping files in cache. Browsers have policies for this sort of thing, and they are usually playing by the rules laid down in the HTTP specification. When a browser makes a request to a server, part of the response is an EXPIRES header.. a date which tells the browser how long it should be kept in cache. The next time the browser comes across a request for the same file, it sees that it has a copy in cache and looks to the EXPIRES date to decide whether it should be used.

So believe it or not, it’s actually your server that is making that browser cache so persistent. You could adjust your server settings and change the EXPIRES headers, but the little technique I’ve written above is probably a much simpler way for you to go about it. Since caching is good, you usually want to set that date far into the future (a “Far-future Expires Header”), and use the technique described above to force a change.

If you’re interested in more info on HTTP or how these requests are made, a good book is “High Performance Web Sites” by Steve Souders. It’s a very good introduction to the subject.

Another useful article:

Can We Prevent CSS Caching?

Get the “text” of the selected “option” using PHP and JavaScript

28th August 2025 JavaScript and jQuery, PHP No comments

This is not something that can be done through PHP alone. The PHP script can only “see” the information which is posted (the value for the selected option that is posted). You can use javascript to alter a hidden input field with the text contents of a selected option, and this will be included in the $_POST array:

<form  action="test.php"  method="POST">  
    <select id="test" onchange="document.getElementById('text_content').value=this.options[this.selectedIndex].text">
     <option value="1">Test One</option>
     <option value="2">Test Two</option>
    </select>

<input type="hidden" name="test_text" id="text_content" value="" />
</form>

 

This will make the $_POST['test_text'] available with the selected index (but you should also force the onchange() function when the page loads so that it will be populated even if the user leaves the select field at the default value.

Redux | The Missing Guide

28th August 2025 Uncategorised No comments

Differences between INDEX, PRIMARY, UNIQUE, FULLTEXT in MySQL

28th August 2025 MySQL No comments

Differences

  • KEY or INDEX refers to a normal non-unique index. Non-distinct values for the index are allowed, so the index may contain rows with identical values in all columns of the index. These indexes don’t enforce any restraints on your data so they are used only for making sure certain queries can run quickly.
  • UNIQUE refers to an index where all rows of the index must be unique. That is, the same row may not have identical non-NULL values for all columns in this index as another row. As well as being used to speed up queries, UNIQUE indexes can be used to enforce restraints on data, because the database system does not allow this distinct values rule to be broken when inserting or updating data.Your database system may allow a UNIQUE index to be applied to columns which allow NULL values, in which case two rows are allowed to be identical if they both contain a NULL value (the rationale here is that NULL is considered not equal to itself). Depending on your application, however, you may find this undesirable: if you wish to prevent this, you should disallow NULL values in the relevant columns.
  • PRIMARY acts exactly like a UNIQUE index, except that it is always named ‘PRIMARY’, and there may be only one on a table (and there should always be one; though some database systems don’t enforce this). A PRIMARY index is intended as a primary means to uniquely identify any row in the table, so unlike UNIQUE it should not be used on any columns which allow NULL values. Your PRIMARY index should be on the smallest number of columns that are sufficient to uniquely identify a row. Often, this is just one column containing a unique auto-incremented number, but if there is anything else that can uniquely identify a row, such as “countrycode” in a list of countries, you can use that instead.Some database systems (such as MySQL’s InnoDB) will store a table’s records on disk in the order in which they appear in the PRIMARY index.
  • FULLTEXT indexes are different from all of the above, and their behaviour differs significantly between database systems. FULLTEXT indexes are only useful for full text searches done with the MATCH() / AGAINST() clause, unlike the above three – which are typically implemented internally using b-trees (allowing for selecting, sorting or ranges starting from left most column) or hash tables (allowing for selection starting from left most column).Where the other index types are general-purpose, a FULLTEXT index is specialised, in that it serves a narrow purpose: it’s only used for a “full text search” feature.

Similarities

  • All of these indexes may have more than one column in them.
  • With the exception of FULLTEXT, the column order is significant: for the index to be useful in a query, the query must use columns from the index starting from the left – it can’t use just the second, third or fourth part of an index, unless it is also using the previous columns in the index to match static values. (For a FULLTEXT index to be useful to a query, the query must use all columns of the index.)

Insider Secrets to Maximizing the Fansbet Co.Uk Welcome Package

28th August 2025 Uncategorised No comments

Insider Secrets to Maximizing the Fansbet Co.Uk Welcome Package

Welcome to a deep dive into the most generous welcome offer in the UK crypto casino market. Whether you are a seasoned player or just starting, understanding how to extract real value from the Fansbet Co.Uk welcome package can turn a modest deposit into a solid bankroll. In this guide we’ll explore the bonus structure, the best games to play, how fast withdrawals work, and the safety measures that keep UK players protected. By the end, you’ll know exactly which steps to take to make the most of every bonus credit and enjoy a seamless gaming experience.

The Core Challenge for UK Crypto Players

Many UK gamers love the anonymity and speed that cryptocurrency brings, but they often stumble over three common hurdles: confusing bonus terms, slow payout times, and limited game selection that truly leverages crypto deposits. A typical pitfall is accepting a welcome bonus without reading the wagering requirements, only to discover that the fast withdrawals promised are locked behind high playthrough thresholds. Another issue is choosing a platform without a proper gaming licence, which can leave your funds at risk. Finally, players sometimes miss out on the most rewarding online slots because they stick to the default game list instead of exploring the full catalogue.

Fansbet Co.Uk was built to solve these exact problems. The site holds a UK Gambling Commission licence, guaranteeing that all games are fair and that player data is secured. Its crypto‑friendly payment gateway accepts Bitcoin, Ethereum, and several stablecoins, delivering withdrawal times that can be as quick as a few minutes. By focusing on a transparent bonus structure and a massive library of over 3,500 titles, the platform removes the guesswork for UK players who want both speed and variety.

How the Fansbet Co.Uk Welcome Package Works

The welcome package at Fansbet Co.Uk is split into three tiers, each designed to reward you as you grow your bankroll:

Tier Deposit Match Free Spins Wagering Requirement
1️⃣ 100% up to £200 50 25x
2️⃣ 50% up to £150 30 30x
3️⃣ 25% up to £100 20 35x

All tiers are eligible for fast withdrawals once the wagering is met.

To claim the bonus, simply register, verify your account, and make your first crypto deposit. The system automatically credits the match bonus and free spins. Because the platform uses a cryptocurrency casino engine, the bonus funds are stored in a separate crypto wallet, ensuring instant access once the playthrough is satisfied.

Quick Tips for Maximizing Value

  • Play low‑volatility slots with RTP ≥ 96% to meet wagering faster.
  • Use free spins on featured slot games that contribute 100% toward the requirement.
  • Stake small amounts on live dealer games; they count toward wagering but preserve your bankroll.

For example, imagine you deposit £100 in Bitcoin. You receive a £100 match and 50 free spins on “Starburst Xtra.” By betting £0.10 per spin, you’ll generate £5 in bonus play, which counts fully toward the 25x requirement. After completing the spins, you only need £3.75 of additional wagering to unlock your first withdrawal.

Fast Withdrawals and Secure Payments for UK Players

One of the biggest draws for UK gamers is the promise of fast withdrawals. At Fansbet Co.Uk, crypto payouts are processed on a blockchain network that confirms transactions within seconds to a few minutes, depending on network congestion. Traditional fiat withdrawals are also available via UK bank transfers, typically arriving within 24 hours.

Key security features include:

  • Two‑factor authentication (2FA) on every login.
  • SSL encryption for all data exchanges.
  • Regulated licensing from the UK Gambling Commission, providing a legal safety net.

Because the platform is a cryptocurrency casino, you avoid the delays common with card processors. This is especially valuable for high‑roller players who need quick access to winnings for reinvestment or cash‑out.

Game Variety That Complements the Bonus

The welcome package shines brightest when paired with the right games. Fansbet Co.Uk hosts titles from industry giants such as NetEnt, Microgaming, and Evolution Gaming. Here are three categories that help you clear wagering efficiently:

  1. High‑RTP Slots – “Mega Joker” (99% RTP) and “Blood Suckers” (98% RTP) provide steady returns.
  2. Live Dealer Tables – Blackjack and Roulette have low house edges and count fully toward bonus play.
  3. Crash & Specialty Games – Fast‑paced and often have 100% contribution rates, perfect for quick turnover.

A short comparison table illustrates how these game types stack up for bonus clearance:

Game Type Avg. RTP Typical Bet Range Bonus Contribution
Slots 96‑99% £0.10‑£5 100%
Live Dealer 95‑97% £1‑£50 100%
Crash 98% £0.05‑£10 100%

By focusing your early sessions on these games, you’ll meet the wagering thresholds faster and unlock the fast withdrawals promised by the platform.

Responsible Gaming and Ongoing Rewards

While the welcome package is generous, it’s essential to gamble responsibly. Fansbet Co.Uk offers tools such as deposit limits, self‑exclusion, and session timers. Set a daily budget before you start playing, and stick to it. Remember, the goal is to enjoy the bonuses without chasing losses.

Beyond the initial three tiers, the casino runs a multi‑level cashback VIP program that rewards loyal players with weekly rebates, exclusive tournaments, and higher withdrawal limits. These ongoing perks make Fansbet Co.Uk more than just a welcome offer—it’s a long‑term partner for UK crypto enthusiasts.

By understanding the structure, choosing the right games, and leveraging the platform’s rapid crypto payouts, you can turn the Fansbet Co.Uk welcome package into a powerful bankroll builder. For those seeking these features, Fansbet casino offers a complete solution that blends safety, speed, and variety—all tailored for UK players who love cryptocurrency gaming. Start today, play smart, and watch your winnings grow.

Mastering Bonuses and Free Spins at NationalBet: A Player’s Path to Faster Wins

28th August 2025 Uncategorised No comments

Mastering Bonuses and Free Spins at NationalBet: A Player’s Path to Faster Wins

Finding the right online casino can feel like searching for a needle in a haystack.
You want big bonuses, quick cash‑outs, and games that keep you entertained.
Below we break down how this platform solves those pains and helps you turn free spins into real money.

The Common Challenge: Spotting Trustworthy Bonuses

Every day, players scroll through endless offers promising huge payouts.
But how many of those promotions are truly fair?

Red flags often include vague wagering terms, delayed payouts, and missing licensing information.
If a site hides its regulator or forces you to jump through hoops, your bankroll is at risk.

Among leading platforms, NationalBet online casino stands out with its clear 200% match welcome bonus and a generous bundle of free spins.

What makes this difference matter?

  • Transparency – the bonus terms are listed in plain English.
  • Speed – withdrawals are processed within 24 hours on average.
  • Safety – the site holds a UK Gambling Commission licence.

Common Mistakes New Players Make

• Ignoring the wagering multiplier.
• Overlooking game restrictions on bonus funds.
• Forgetting to verify the payment method before claiming the offer.

Avoid these traps, and you’ll start your journey on a solid foundation.

How NationalBet Solves the Bonus Puzzle

NationalBet’s welcome bonus greets you with a 200% match up to £200 plus 50 free spins on a popular slot.
The wagering requirement is a modest 30×, far lower than the industry average of 40‑50×.

When you claim the bonus, the platform instantly credits your account.
You can then use the funds on any of the live dealer games, slots, or table games listed in the library.

Highlights of the Offer

  • Low wagering: 30× the bonus amount.
  • Fast payouts: most withdrawals complete in 1‑2 business days.
  • Game variety: over 3,000 titles from NetEnt, Microgaming, and Evolution.
  • Mobile‑first design: play on Android or iOS without lag.

These features answer the key question many players ask: “Can I really turn a bonus into cash without endless betting?”
The answer is a confident yes for those who follow the simple steps outlined below.

Real‑World Example: Turning Free Spins into Cash

Imagine you sign up with a ÂŁ20 deposit.
NationalBet matches it 200%, giving you £60 in bonus cash, plus 50 free spins on “Starburst” (RTP 96.1%).

Scenario breakdown:

  1. You play the free spins. Three of them hit the 10× multiplier, adding £5 to your balance.
  2. You meet the 30× wagering on the £60 bonus (£1,800 total bet).
  3. After meeting the requirement, you withdraw the remaining £55 within 24 hours.

The result? A ÂŁ35 profit from a ÂŁ20 stake, all thanks to the free spins and low wagering.

Below is a quick comparison of NationalBet’s bonus versus a typical competitor:

Feature NationalBet Competitor X
Match percentage 200% 150%
Free spins 50 on Starburst 20 on unknown slot
Wagering requirement 30× 45×
Withdrawal speed 1‑2 days 3‑5 days
License UKGC Unclear

Why This Matters

The lower multiplier means you need to bet less to cash out, and the extra free spins give you a head start.
If you’re looking for a quick win, this structure is hard to beat.

Mobile and Live Dealer Experience – Speed Meets Variety

Modern players expect to gamble on the go.
NationalBet’s mobile experience offers a responsive site and a dedicated app that runs smoothly on both smartphones and tablets.

Live dealer games stream in high definition, letting you chat with real dealers while you play blackjack, roulette, or baccarat.
The platform’s fast withdrawals are supported by popular e‑wallets like PayPal, Skrill, and Neteller, ensuring you never wait long for your winnings.

What Players Love

  • Instant deposits via credit cards and e‑wallets.
  • 24/7 live chat support that answers questions in minutes.
  • Responsible gambling tools such as deposit limits and self‑exclusion options.

By combining a sleek mobile UI with a rich live dealer catalog, NationalBet gives you the flexibility to play wherever you are, without sacrificing quality or security.

Quick Tips to Maximize Your Play at NationalBet

  1. Read the bonus terms before you claim – know the wagering and game restrictions.
  2. Start with low‑risk games (e.g., blackjack) to meet the wagering requirement without draining your bankroll.
  3. Use the free spins on high‑RTP slots; they boost your chances of early wins.
  4. Set a withdrawal schedule – plan to cash out once you’re 10% above the bonus amount.
  5. Activate responsible gambling limits to keep your play enjoyable.

Following these steps lets you enjoy the welcome bonus, live dealer games, and mobile experience while staying in control of your bankroll.

NationalBet has built its reputation on clear offers, speedy payouts, and a safe gaming environment.
If you’re ready to turn free spins into real cash and enjoy a trustworthy online casino experience, give the platform a try today.