Freekode
FreeKode | Snippets

[email protected]

Install HomeBrew Mac

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

[email protected]

Install NVM Ubuntu 18.04

cd ~
curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs
nodejs -v

[email protected]

Hide Element In CSS

h1 {

    display:none;

}

[email protected]

CSS Activate On Button Click

button:focus {

    background-color: yellow;

}

[email protected]

Undo Commits in Git

git reset --hard HEAD~1

[email protected]

Curl install PIP

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

python get-pip.py

[email protected]

createElement JavaScript

const btn = document.createElement('button');

btn.innerHTML = "Click";

document.body.appendChild(btn);

[email protected]

Get HTML Element's Attribute's Value in JS

const element = document.querySelector('element');

const attribute = element.getAttribute('attribute');

[email protected]

Remove An Element From An Array JavaScript

var colors = ["red","blue","car","green"];

var carIndex = colors.indexOf("car");

colors.splice(carIndex, 1);

console.log(colors);



First 1 2 3 4 Last