Skip to content

Instantly share code, notes, and snippets.

View JPauloMoura's full-sized avatar
🚀

JP JPauloMoura

🚀
View GitHub Profile
@michelpf
michelpf / Main.java
Created June 30, 2017 01:32
Exemplo de bot do Telegram desenvolvido em Java
public class Main {
public static void main(String[] args) {
//Criação do objeto bot com as informações de acesso
TelegramBot bot = TelegramBotAdapter.build("SEU_TOKEN_DE_ACESSO");
//objeto responsável por receber as mensagens
GetUpdatesResponse updatesResponse;
//objeto responsável por gerenciar o envio de respostas
@douglarek
douglarek / install-openjdk.txt
Last active June 15, 2024 19:20
How to install openJDK 11 on macOS
$ curl -C - https://download.java.net/java/ga/jdk11/openjdk-11_osx-x64_bin.tar.gz -O openjdk-11_osx-x64_bin.tar.gz
$ tar xf openjdk-11_osx-x64_bin.tar.gz
$ sudo mv jdk-11.jdk /Library/Java/JavaVirtualMachines/
$ java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
const options = { year: "numeric", month: "long", day: "numeric" };
const date = new Date(2020, 11, 31) // 2020-12-31T03:00:00.000Z
console.log(date.toLocaleDateString("pt-br", options))
// 31 de dezembro de 2020
console.log(date.toLocaleDateString("pt-br", { ...options, month: 'numeric'}))
// 31/12/2020
const regex = /^([0-9]{4})[-](0[1-9]|1[0-2])[-](0[0-9]|1[0-9]|2[0-9]|3[0-1])/gm
const dateRx = new Date(2020, 11, 31) // 2020-12-31T03:00:00.000Z
@JPauloMoura
JPauloMoura / cluster-config-localhost-ports.md
Created July 24, 2022 01:44
Instrução de como podemos fazer o mapeamento de portas de um cluster kubernets local utilizando o Kind.

Criaremos um cluster kubernetes com:

  • 1 pods
  • 1 service para o pod
  • mapeando configurando as portas do cluster para usar o localhost

config.yaml

Nesse arquivo configuramos o mapeamento de portas entre o node e o host local. [localhos:8080] -> [nodeIP:30000]