This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"terminal.integrated.fontSize": 15, | |
"workbench.iconTheme": "material-icon-theme", | |
"workbench.startupEditor": "newUntitledFile", | |
"editor.tabSize": 2, | |
"editor.fontSize": 16, | |
"editor.lineHeight": 22, | |
"editor.fontFamily": "Fira Code", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def will_print(message): | |
"Outer Function" | |
def will_question(): | |
"Nested Function" | |
print(message) | |
will_question() #yes! | |
will_print("Some random message") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fizz_buzz_generator(function): | |
def wrapper(): #standar name | |
func = function() | |
lista =[] | |
for x in range(1,func+1): | |
if x%3==0 and x%5==0 : | |
lista.append("FizzBuzz") | |
elif x%5==0: | |
lista.append("Buzz") | |
elif x%3==0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let decimalToBinary = (dec=0) => (dec >> 0).toString(2) | |
let binaryToDecimal = (bin) => parseInt(bin, 2).toString(10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let isoCountries = { | |
AF: "Afghanistan", | |
AX: "Aland Islands", | |
AL: "Albania", | |
DZ: "Algeria", | |
AS: "American Samoa", | |
AD: "Andorra", | |
AO: "Angola", | |
AI: "Anguilla", | |
AQ: "Antarctica", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function composition(...functions){ | |
return function(value){ | |
return functions.reduce((acc, fn) =>fn(acc), value) | |
} | |
}//very flexible | |
function scream(text){ | |
return text.toUpperCase() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//easy to visualize and code, but... | |
function fib(n) { | |
if (n <= 1) return 1; | |
return fib(n - 1) + fib(n - 2); | |
} | |
//very time-consuming. | |
//SOLUTION | |
//using memoization | |
function fib(n) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<script> | |
let xhr = new XMLHttpRequest | |
xhr.open('GET', 'https://api.github.com/users/DiogoJBasso') | |
xhr.send(null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//DISCLAIMER: Esses desafios podem ser encontrados na página da RocketSeat | |
/*Enunciado: | |
Crie uma função que dado o objeto a seguir: | |
var endereco = { | |
rua: "Rua dos pinheiros", | |
numero: 1293, | |
bairro: "Centro", | |
cidade: "São Paulo", | |
uf: "SP" | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
df = pd.read_csv("https://pycourse.s3.amazonaws.com/bike-sharing.csv") | |
df.head() |
OlderNewer