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
data = [] | |
url = "minha-api" | |
params = {} | |
def get_pages(page: int = 0): | |
data = [] | |
if page: params["next"] = page | |
result = get(url, params=params).json() |
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
data = [] | |
url = "minha-api" | |
params = {} | |
while True: | |
result = get(url, params=params).json() | |
data.extend(result["meus_dados"]) | |
if not "next" in result.keys(): break |
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
from random import randint | |
def gerar_dv(digitos: list, first_dv: bool): | |
digitos = digitos[0:len(digitos) - (2 if first_dv else 1)] | |
sequencia = list(reversed(range(2, 6 if first_dv else 7))) | |
sequencia = [ *sequencia, *list(reversed(range(2, 10))) ] | |
soma = sum([ digito * num for digito, num in zip(digitos, sequencia) ]) | |
dv = 11 - (soma % 11) |
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
<html> | |
<p>Valores diferentes:</p> | |
<ul>{{ MISSING }}</ul> | |
<br> | |
<p>Não listados na planilha:</p> | |
<ul>{{ NOT_LISTED }}</ul> | |
<br> | |
<p>Não encontrados:</p> | |
<ul>{{ MISSING }}</ul> | |
<br> |
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
<?php | |
$handle = curl_init('https://your-requestbin-endpoint.pipedream.net/'); | |
$data = [ | |
'add your data' => "here", | |
'anything' => $goes, | |
'even' => array(), | |
'and' => new Objects() | |
]; |
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
// Use um conjunto de "from" para acessar a sequência interna de cada elemento. | |
var scoreQuery = | |
from student in students | |
from score in student.Scores | |
where score > 90 | |
select new { | |
Last = student.LastName, | |
score | |
}; |
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
var seattleCustomers2 = | |
from cust in customers | |
where cust.City == "Seattle" | |
orderby cust.Name | |
select cust; |
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
var seattleCustomers = | |
from cust in customers | |
where cust.City == "Seattle" | |
select cust.Name; |
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
var localDistribuitors2 = | |
from cust in customers | |
join dist in distribuitors | |
on cust.City equals dist.City | |
select new { | |
CustomerName = cust.Name, | |
DistribuitorID = dist.id | |
}; |
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
var localDistribuitors = | |
from customer in customers | |
join distribuitor in distribuitors | |
on customer.City equals distribuitor.City | |
select new { | |
Customer = customer, | |
Distribuitor = distribuitor | |
}; |
NewerOlder