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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / chrome.sh
Created October 18, 2020 00:45
Debian Install Google Chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
@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
@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