/AlphaCoding

A collection of curated tricks and trips from all over the deep ends of internet

AlphaCoding

Github

GitHub Secret VSCode Web Editor

To open the repository in the same browser tab, press . while browsing any repository or pull request on GitHub.

To open the repository in a new browser tab, hold down the shift key and press ..

Change the URL from "github.com" to "github.dev".

When viewing a file, use the dropdown menu next to and select Open in github.dev. \

Tricks to create an impressive GitHub repository

  1. 𝗔𝗱𝗱 𝗧𝗮𝗴𝘀 𝗮𝗻𝗱 𝗼𝗻𝗲 𝗹𝗶𝗻𝗸
    Adding tags is the next and most crucial step in this article. It not only makes it easier for GitHub to promote the repository but also makes it look much more professional!

  2. 𝗔𝗱𝗱 𝗗𝗲𝘀𝗰𝗿𝗶𝗽𝘁𝗶𝗼𝗻 (𝘄𝗶𝘁𝗵 𝗘𝗺𝗼𝗷𝗶𝘀 & 𝗟𝗶𝗻𝗸)
    This is the lowest hanging fruit in creating an impressive GitHub repository. You can just add a short description of the repository to heighten its appeal. Make sure to throw in some emojis too

  3. 𝗔𝗱𝗱 𝗘𝗺𝗼𝗷𝗶 𝗮𝗻𝗱 𝗚𝗜𝗙𝘀 𝗶𝗻 𝘁𝗵𝗲 𝗥𝗲𝗮𝗱𝗠𝗲 𝗳𝗶𝗹𝗲
    The ReadME file is the first thing that a user sees. The ReadMe is the first thing a visitor sees when they visit the repository, so taking some time to create a polished repository is crucial. It should describe what problem the code solves, how to set it up, and any other relevant information. \

Autocorrection

git config --global help.autocorrect 1

This command enables the autocorrection feature.Instead of suggesting an alternative subcommand, Git now just runs the top suggestion


Javascript

Check battery status with javascript

if(navigator.getBattery){
    // if battery API is working
    navigator.getBattery()
    .then(function(battery) {

        // Get current battery level .
        var batteryLevel = battery.level * 100;
        console.log(batteryLevel);
    })
    .catch(function(e) {
        console.error(e);
    });
}
else{
    // if battery API is not working
}

The promise returns a BatteryManager object which have several properties and methods related to battery and charging.