Skip to content

Instantly share code, notes, and snippets.

View jeffersonchaves's full-sized avatar
😎
Focusing

Jefferson Chaves jeffersonchaves

😎
Focusing
  • Instituto Federal do Paraná - IFPR
  • Foz do Iguaçu - PR
View GitHub Profile
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>JPALab</groupId>
<artifactId>JPALab</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<plugins>
self.app = app
self.app.config['MYSQL_DATABASE_USER'] = 'jrh723dnnjs1u5ce'
self.app.config['MYSQL_DATABASE_PASSWORD'] = 'w8hzubq4xseu9djj'
self.app.config['MYSQL_DATABASE_DB'] = 'gcj94fo1u2n7n1ze'
self.app.config['MYSQL_DATABASE_HOST'] = 'z5zm8hebixwywy9d.cbetxkdyhwsb.us-east-1.rds.amazonaws.com'
self.mysql = MySQL(cursorclass=pymysql.cursors.DictCursor)
self.mysql.init_app(self.app)
@jeffersonchaves
jeffersonchaves / Lista Python.md
Created November 16, 2021 13:10
Lista Python

#Python Flask Introdução

Esta é uma breve introdução ao framework Flask e pode servir como um tutorial prático para dar os primeiros passos com o Flask.

Irei mostrar como instalar o Flask de modo bem simples e também mostrar o “Hello World!” com Flask, além de uma breve noção do que vem a ser esse tal de Fask…

O que é Flask ?

Flask é um micro-framework para Python, segundo a documentação…

programa
{
funcao inicio()
{
inteiro tamanho_tabua = 5
inteiro tamanho_tabua_cm = tamanho_tabua * 100
inteiro tamanho_pedaco_cm = 45
inteiro numero_pedacos = 0
@jeffersonchaves
jeffersonchaves / gist:3f0a74db2af7ffc4f70cf7346bd7a999
Created September 16, 2021 18:18
Servlet Base Path Snippet
String getBaseUrl(HttpServletRequest request) {
String baseUrl = request.getRequestURL().substring(0, request.getRequestURL().length() - request.getRequestURI().length()) + request.getContextPath();
return baseUrl;
}

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

package app;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@jeffersonchaves
jeffersonchaves / curl.md
Created September 2, 2021 13:12 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

package database;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConnectionFactory {
private static Connection connection;