This file contains hidden or 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 com.fasterxml.jackson.annotation.JsonIgnoreProperties | |
import com.fasterxml.jackson.annotation.JsonProperty | |
@JsonIgnoreProperties(ignoreUnknown = true) | |
data class User( | |
@field:JsonProperty("name") | |
val name: String, | |
@field:JsonProperty("age") | |
val age: Int, |
This file contains hidden or 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
$ docker run -d --cap-add=IPC_LOCK -e 'VAULT_DEV_ROOT_TOKEN_ID=myroot' -e 'VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:1234' -p 8200:1234 vault | |
$ docker stop vault | |
$ docker start vault |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"text/template" | |
) | |
func main() { | |
// string template | |
t := template.Must(template.New("secrets").Parse("Hello, my token is: {{.TOKEN}}")) |
This file contains hidden or 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 difflib import SequenceMatcher | |
def similarity(string1: str, string2: str) -> float: | |
return SequenceMatcher(a=string1, b=string2).ratio() | |
def similarity_in_percent(string1: str, string2: str) -> float: | |
value = similarity(string1, string2) * 100 | |
return round(value, 2) |
This file contains hidden or 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
players = [ | |
{"name": "Pelé","age": 80}, | |
{"name": "Beckenbauer", "age": 75}, | |
{"name": "Baresi", "age": 61}, | |
{"name": "Zamorano", "age": 54}, | |
{"name": "Mauro Shampoo", "age": 64} | |
] | |
sorted_players_by_name = sorted(players, key=lambda k: k["name"]) | |
sorted_players_by_age = sorted(players, key=lambda k: k["age"]) |
This file contains hidden or 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 classes import ExcerptInfo | |
from datetime import datetime | |
import csv | |
EXCERPT_RAW_MODAL = "" | |
FORMATTED_EXCERPT_CSV = "" | |
class ExcerptInfo: | |
def __init__(self, date): |
This file contains hidden or 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 requests | |
import json | |
import datetime | |
bacen_ipca_url = "https://api.bcb.gov.br/dados/serie/bcdata.sgs.189/dados?formato=json" | |
output_json = "/home/bla/Desktop/igpm.json" | |
metadata = { | |
"status": "ATIVO", | |
"data-ultima-atualizacao": datetime.datetime.now().strftime('%d/%m/%Y'), | |
"versao": "1.1.0", |
This file contains hidden or 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 lombok.RequiredArgsConstructor; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; | |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | |
@Configuration | |
@RequiredArgsConstructor | |
public class WebConfiguration implements WebMvcConfigurer { | |
private final MyInterceptor requestInterceptor; |
This file contains hidden or 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
{ | |
"meta-info":{ | |
"status": "DEPRECATED", | |
"data-ultima-atualizacao":"2018-08-29", | |
"data-referencia":"2017-07-01", | |
"versao":"1.0.3", | |
"website":"https://medium.com/@rgiaviti/munic%C3%ADpios-brasileiros-em-formato-json-32337dd00d49", | |
"fontes":[ | |
"IBGE" | |
] |
This file contains hidden or 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
{ | |
"meta-info":{ | |
"status": "DEPRECATED", | |
"data-ultima-atualizacao":"2018-07-25", | |
"data-referencia":"2017-07-01", | |
"versao":"1.0.2", | |
"website":"https://medium.com/@rgiaviti/unidades-federativas-do-brasil-como-json-1a40c0ec2cff", | |
"fontes":[ | |
"IBGE", | |
"Constituição do Brasil" |
NewerOlder