Skip to content

Instantly share code, notes, and snippets.

View alechristian's full-sized avatar
🇧🇷

Christian Alexandre alechristian

🇧🇷
View GitHub Profile
--------------- EXERCICIO 4 -----------------
-- INSERT usuários
INSERT INTO usuario (email, nome, ult_acesso) VALUES
('adailton@positivo.com.br', NULL , NULL),
('laishc@positivo.com.br', NULL , NULL),
('usuario32024@positivo.com.br', NULL , NULL),
('djuliads@positivo.com.br', NULL , NULL),
('guilhermesouza@positivo.com.br', NULL , NULL);
-- USUARIO
CREATE TABLE usuario (
usuario_id SERIAL PRIMARY KEY,
email VARCHAR(150) NOT NULL UNIQUE,
nome VARCHAR(100) NULL, -- (att) O nome do usuário não é informado pelo usuário no momento do cadastro
ult_acesso TIMESTAMP NULL
);
-- PAPEL
CREATE TABLE papel (
[
{
"Id": "9ba2bf24-ae6f-eb11-a3ed-ace010d397c3",
"IdBaia": "6c22eeff-3633-eb11-99ed-ace010d397c3",
"IdPlanejamentoFase": "80fa18fd-c5e6-e811-a22d-ace010d397c3",
"Fornecimento": 100,
"NomeTrato": "1° trato",
"NumeroTrato": 1,
"Previsto": 1979,
"RealizaTrato": true,
#include <stdio.h>
#include <stdlib.h>
struct Edge {
int src, dest;
};
int** InicializarGrafo(struct Edge* edges, int n, int m) {
int** grafo = (int**)malloc(n * sizeof(int*));
for (int i = 0; i < n; i++) {
@alechristian
alechristian / axios-node.js
Created January 17, 2023 20:12
Axios + Node.js
//* UTILIZANDO O AXIOS
var axios = require('axios');
var dados;
function usuarioGitHub(){
return axios.get("https://api.github.com/users/alechristian")
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i, n;
printf("\nQuantos numeros?\n");
scanf("%d", &n);
float *ptr = (float *) malloc (n*sizeof(float));
if (ptr == NULL)
{
@alechristian
alechristian / cep.js
Created January 13, 2023 12:48
Integração com terceiros
const express = require('express')
const router = express.Router()
const ApiNodeCorreios = require('node-correios')
const correios = new ApiNodeCorreios()
router.post('/', (request, response) => {
const { cep } = request.body
correios.consultaCEP({ cep }).then(result => {
@alechristian
alechristian / calculo-frete.js
Created January 10, 2023 17:06
Server e Calculo Frete
//Projeto Awari - Aula: "Melhorando Calculos"
function calculaFrete(cidade, estado) {
switch(estado){
case "SP":
console.log('"R$5,00"');
break;
case "RJ":
console.log('"R$6,50"');
break;
@alechristian
alechristian / exporacao-inicial
Created January 10, 2023 11:28
Exploraçao inicial
Gostei bastante deste início de curso, a forma na qual cada status de retorno tem um significado desta forma ajudando
o desenvolvedor front-end a identificar rapidamente o problema, caso tenha, se o status for diferente do 200.
Um breve resumo:
200 OK
Indicates that the request has succeeded.
201 Created
Indicates that the request has succeeded and a new resource has been created as a result.
202 Accepted
@alechristian
alechristian / calculadora-frete
Created January 9, 2023 18:04
Calculadora-frete-etapa2
//Projeto Awari - Aula: "Melhorando Calculos"
function calculaFrete(cidade, estado) {
switch(estado){
case "SP":
console.log('"R$5,00"');
break;
case "RJ":
console.log('"R$6,50"');
break;