Skip to content

Instantly share code, notes, and snippets.

View hebertcisco's full-sized avatar
🎯
Focusing

Hebert F. Barros hebertcisco

🎯
Focusing
View GitHub Profile
@hebertcisco
hebertcisco / ArmazenandoJSON.js
Created April 10, 2021 22:06
Armazenando dados JSON
// Armazenando dados:
meuObj = {nome: "Hebert", idade: 19, cidade: "Gyn"};
meuJSON= JSON.stringify(meuObj );
localStorage.setItem("testJSON", meuJSON);
// Recuperando dados:
text = localStorage.getItem("testJSON");
obj = JSON.parse(text);
document.getElementById("demo").innerHTML = obj.name;
@hebertcisco
hebertcisco / NovoPrecoDoProduto.js
Created December 12, 2020 14:05
Crie um programa que calcule um novo preço de um produto, com acréscimo de 20%
function NovoPrecoDoProduto(preco) {
var acrescimo = (20 / 100) * preco;
return console.log(preco + acrescimo);
}
NovoPrecoDoProduto(10);
@hebertcisco
hebertcisco / MultiplicaNumerosReais.js
Last active December 12, 2020 13:49
Crie um programa que multiplique dois números reais
function MultiplicaNumerosReais(num1, num2) {
return console.log(num1 * num2);
}
MultiplicaNumerosReais(2, 2);
@hebertcisco
hebertcisco / install.sh
Created November 1, 2020 00:44
Ubuntu Installation Automation
#!/bin/bash
## By Hebert F. Barros 2019
## Removing any apt ## crashes
sudo rm /var/lib/dpkg/lock-frontend ; sudo rm /var/cache/apt/archives/lock ;
sudo apt-get update
echo 'installing curl'
sudo apt install curl -y
@hebertcisco
hebertcisco / chocolatey.ps1
Created October 24, 2020 15:04
Installing Chocolatey Windows
Set-ExecutionPolicy AllSigned
Set-ExecutionPolicy Bypass -Scope Process
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco -?
@hebertcisco
hebertcisco / sources.list
Created October 23, 2020 19:09
sources.list Ubuntu 20.10 Groovy Gorilla
#deb cdrom:[Ubuntu 20.10 _Groovy Gorilla_ - Release amd64 (20201022)]/ groovy main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://br.archive.ubuntu.com/ubuntu/ groovy main restricted
# deb-src http://br.archive.ubuntu.com/ubuntu/ groovy main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://br.archive.ubuntu.com/ubuntu/ groovy-updates main restricted
@hebertcisco
hebertcisco / kdenlive-gpu-rendenring.profile
Created October 21, 2020 00:40
Render by GPU (AMD) in Kdenlive
f=mp4 movflags=+faststart hwaccel_device=/dev/dri/renderD128 vf=‘format=nv12,hwupload’ c:v=h264_vaapi vcodec=h264_vaapi threads=2 preset=faster g=15 bf=2 vb=10M acodec=aac ab=256k
@hebertcisco
hebertcisco / get-node.sh
Last active November 14, 2020 03:19
Install Node.js Unix
echo 'installing nvm'
curl -fsSL https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | sh
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn node npm
sudo apt update && sudo apt install --no-install-recommends yarn
export PATH="$PATH:/opt/yarn-[version]/bin"
@hebertcisco
hebertcisco / pip-install.sh
Created October 19, 2020 16:09
Install pip with Python 3
wget -c https://bootstrap.pypa.io/get-pip.py
python get-pip.py
@hebertcisco
hebertcisco / swift-install.sh
Last active October 18, 2020 18:51
Swift Installation Automation on Ubuntu
#!/bin/bash
## By Hebert F. Barros
echo 'Removing any apt crashes...'
sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/cache/apt/archives/lock
echo 'Updating the dependencies...'
sudo apt-get update