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 / vs-code.sh
Created October 18, 2020 00:39
Debian Install VS Code
echo 'installing code'
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get install apt-transport-https -y
sudo apt-get update
sudo apt-get install code -y # or code-insiders
@hebertcisco
hebertcisco / Plank-Config.desktop
Created October 17, 2020 20:46
Plank-Config.desktop
[Desktop Entry]
Name=Plank Config
GenericName=Dock config
Comment=Stupidly simple.
Categories=Utility;
Type=Application
Exec=plank --preferences
Icon=plank
Terminal=false
NoDisplay=false
@hebertcisco
hebertcisco / sources.list
Created September 22, 2020 16:31
Ubuntu 20.04 LTS (Focal Fossa) - Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
@hebertcisco
hebertcisco / toCamelCase.js
Created September 16, 2020 03:23
Convert string to camel case" algorithm, CodeWars
function toCamelCase(str){
if(str === ''){
return ''
} else {
let containmentArea = []
let splitString = str.replace(/[^A-Z0-9]/ig, "_").split("_")
let firstElement = containmentArea.push( splitString.splice(0,1) )
for(let word in splitString){
@hebertcisco
hebertcisco / GenderOfThePerson.py
Created September 12, 2020 01:13
Escrever um algoritmo que leia o nome e o sexo de 5 pessoas e informe o nome e se ela é homem ou mulher. No final informe total de homens e de mulheres.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def GenderOfThePerson():
nome = raw_input("Insira um nome: ")
sexo = input(
"Qual o sexo de {Nome}? \n\n 1. Homem \n\n 2. Mulher\n\n".format(Nome=nome))
if sexo == 1:
print("{Nome} é homem".format(Nome=nome))
@hebertcisco
hebertcisco / some.ts
Created May 23, 2020 05:34
The some() method tests whether any of the elements in the array pass the test implemented by the assigned function.
const age_user = [
{
name: "Jane Dow",
age: 39,
},
{
name: "John Doe",
age: 39,
},
{
@hebertcisco
hebertcisco / find.ts
Created May 23, 2020 05:33
The find() method returns the value of the first element of the array that satisfies the provided test function. Otherwise, undefined is returned.
const userISPRO = [
{
nome: "John",
pro: true,
},
{
nome: "Hima",
pro: false,
},
{
@hebertcisco
hebertcisco / reduce.ts
Created May 23, 2020 05:31
The reduce() method performs a reducing function (download for you) for each element of the matrix, resulting in a single return value.
const githubStars = [
{
userID: "tecnobert",
userStars: 88,
},
{
userID: "philipwalton",
userStars: 36,
},
{
@hebertcisco
hebertcisco / map.ts
Created May 23, 2020 05:30
The map () method invokes the callback function passed by argument for each element of the Array and returns a new Array as a result.
const temperatureCelsius = [0, 22, 31, 40, 45, 12, 3];
const toFahrenheit = (value) => (value * 9) / 5 + 32;
const temperatureFahrneheit = temperatureCelsius.map(toFahrenheit);
console.log(temperatureCelsius);
console.log(temperatureFahrneheit);
@hebertcisco
hebertcisco / foreach.ts
Created May 23, 2020 05:29
One declaration for each in repeating a specified variable over all values ​​of the object's properties. For each distinct property, a specific declaration is executed.
const mySkills = [
"C#",
"JavaScript",
"TypeScript",
"HTML",
"CSS3",
"Angular",
"ReactJS",
"React Native",
"NodeJs",