This video is just awesome. I saw it on National Geographic, and I was really surprised by the iguana's skills.

This show us how much we keep learning from our mother nature.

Today I start a new adventure with funceble, a new script to check domains or IP availability.

Funceble is now described as:

[an] excellent script for checking ACTIVE, INACTIVE and EXPIRED domain names.

Where does the idea come from?

The idea of the script came under a discussion around the famous Steven Black's hosts file(s). Indeed, the hosts file is really great but the main problem is that the there's probably many domains that do not exist anymore.

So I planned to write funceble.

An explanation of the script ?

A full releases changelog can be found here.


Special Thanks

Thank you for your awesome hosts lists, support or contributions which helped (and/or still help) me build this script. :smile: :+1:

Contributors

Thank you for your awesome ideas or contributions which make or made funceble better!! :+1: :100: :1st_place_medal:


Supporting the project

Funceble and dead-hosts are powered by :coffee:!

This project helps you and or you like it? Why don't you Buy me a cup of coffee? :smile_cat:

Today I explain how to generate some random background with javascript!

Functions

In order to be more efficient I choose to write some Functions.

backgrounds()

We need a function which return a list of link (or filename) to use as background.

/**
 * Return a list of URL
 */
function backgrounds() {
    // We create a variable
    var imageURLs = [
        // We assign in an array the list of URL/filename we want as background
        "https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-301322.jpg",
        "https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-103541.jpg",
        "https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-279000.jpg",
        "https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-106689.jpg",
        "https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-365847.jpg",
        "https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-284161.jpg"
    ];

    // We return the created variable
    return imageURLs;
}

randomNumber()

We need a function that return a random in range [0-x] where x is the length of backgrounds().

/**
 * Return a random number in range [0-x] where x is the length of backgrounds
 * @param {int} max
 * @returns {int}
 */
function randomNumber(max) {
    return Math.floor((Math.random() * max));
}

getBackground()

We need a function that return a background from backgrounds() with randomNumber() as index.

/**
 * Get a random url from backgrounds
 * @returns {str}
 */
function getBackground() {
    var numberOfImages = backgrounds().length,
        uniqueNumber = randomNumber(numberOfImages);
    return backgrounds()[uniqueNumber];
}

showBackground()

we need a function that return a well formatted css for the background.

/**
 * show background on screen
 * @returns {DOM}
 */
function showBackground() {
    document.body.style.backgroundImage = "url('" + getBackground() + "')";
    document.body.style.backgroundPosition = "center center";
    document.body.style.backgroundRepeat = "no-repeat";
    document.body.style.backgroundAttachment = "fixed";
}

Load all on page loading

// On load, we show the background on screen
window.onload = showBackground();

Final script

Known issue

This script doesn't work on safari.

Intelligence defends peace. Intelligence has a horror of war.

Honoré de Balzac

If privacy is outlaw, only bandits will have a private life.

Phil Zimmermann