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 a base image com Java 11 | |
FROM openjdk:11-jdk-slim | |
# Define o mantenedor do Dockerfile | |
LABEL maintainer="pedro@vasconcellos.solutions" | |
# Atualiza os pacotes e instala o Maven | |
RUN apt-get update && apt-get install -y maven | |
# Cria um diretório para a aplicação |
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
------------------------------------------------------------------------------------------------------------------ | |
VS-CODE | |
Depuração: | |
Step Over: F10 | |
Step Into: F11 | |
Step Out: Shift + F11 | |
Resume Program: F5 | |
Pause Program: F6 |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"args": [], | |
"cwd": "${workspaceRoot}", | |
"env": { | |
"NODE_ENV": "development" | |
}, | |
"name": "DEBUG", |
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
class Utilities { | |
public static isValidStringHeaders(headers: string): boolean { | |
const regex = /^[a-zA-Z0-9,_]+$/; | |
return regex.test(headers); | |
} | |
public static isValidStringHeaders(headers: string): boolean { | |
const allowedCharacters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_,'; | |
for (let i = 0; i < headers.length; i++) { |
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
type StringMap = Map<string, string>; | |
export class ResultT<T> { | |
value: T | null; | |
errors: StringMap; | |
constructor() { | |
this.value = null; | |
this.errors = new Map<string, string>(); | |
} |
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
public void Print(HttpClient httpClient){ | |
var jsonContent = await response.Content.ReadAsStringAsync(); | |
Console.WriteLine($"curl -X {httpClient.HttpRequestMessage.Method} \"{url}\" \\\n" + | |
$"{GetHeadersAsString(httpClient.HttpRequestMessage.Headers)} \\\n" + | |
$"-d \"{jsonContent}\""); | |
} | |
static string GetHeadersAsString(HttpHeaders headers) | |
{ |
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
#Checks for the presence of directory /usr/local/go/bin in $PATH. | |
echo "$PATH" | grep -q -E "(^|:)/usr/local/go/bin($|:)" | |
is_present=$? | |
if [ $is_present -eq 1 ]; then | |
export PATH=$PATH:/usr/local/go/bin | |
echo "add go bin" | |
fi |
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
type ResultT struct { | |
Response interface{} | |
Errors map[string]string | |
} | |
func NewResultT() ResultT { | |
return ResultT{ | |
Response: nil, | |
Errors: make(map[string]string), | |
} |
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 std::collections::HashMap; | |
pub struct ResultT<T> { | |
response: Option<T>, | |
errors: HashMap<String, String>, | |
} | |
impl<T> ResultT<T> { | |
pub fn new() -> Self { | |
ResultT { |
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
public static class EnumExtensions | |
{ | |
public static T? GetDefaultValue<T>() where T : Enum | |
{ | |
var enumType = typeof(T); | |
var defaultValueAttribute = Attribute | |
.GetCustomAttribute(enumType, typeof(DefaultValueAttribute)) as DefaultValueAttribute; | |
if (defaultValueAttribute is not null && | |
defaultValueAttribute.Value is T) |
NewerOlder