Skip to content

Instantly share code, notes, and snippets.

View gabrielsaints's full-sized avatar
:octocat:

Gabriel Santos gabrielsaints

:octocat:
View GitHub Profile
@gabrielsaints
gabrielsaints / postgresql.php
Created April 25, 2018 23:16
Classe de PHP para conexão de banco PostgreSQL
<?php
//draw.io -- banco
class PostgreSQL {
private $connection;
private $errorMessage = "<script type='text/javascript'>alert('Oops! Algo de errado não está correto.')</script>";
private $result;
private $queryCount;
/*Estabelece a conexão com o banco através de um vetor*/
@gabrielsaints
gabrielsaints / last-version.cpp
Created April 26, 2018 18:52
conclusion-project-in-c
#include <stdio.h>
#include <stdlib.h>
#include <conio.c>
#include <conio.h>
#include <windows.h>
#include <string.h>
#define f 1
#define fc 9
#define fca
#define qtdetxt 40
int buzzer = 2;
int botao = 4;
int poten = A0;
int cont=0;
int valor_botao;
int led=3;
void setup() {
pinMode(botao, INPUT);
@gabrielsaints
gabrielsaints / houzion-db.sql
Last active October 31, 2018 23:08
tcc-database
DROP FUNCTION IF EXISTS GetTableContent(INTEGER);
DROP TABLE IF EXISTS registro;
DROP TABLE IF EXISTS permite_cena;
DROP TABLE IF EXISTS cena;
DROP TABLE IF EXISTS agendamento;
DROP TABLE IF EXISTS rotina;
DROP TABLE IF EXISTS permissao;
DROP TABLE IF EXISTS alerta;
DROP TABLE IF EXISTS controle;
DROP TABLE IF EXISTS ambiente;
@gabrielsaints
gabrielsaints / houzion.ino
Last active August 16, 2018 00:27
script that's control the houzion application
//conections
//const int LM35 = 0;
//const int TEMPERATURE_VALIDATION[2] = {2, 3};
//statements
const int LED = 1;
const int T_LM35 = 2;
const int LED_ON = 1;
const int LED_OFF = 0;
@gabrielsaints
gabrielsaints / PostgreSQL.java
Created August 17, 2018 00:06
PostgreSQL class for Java
import java.sql.*;
import javax.swing.*;
import java.util.*;
public class PostgreSQL{
private int _code;
private String _type;
private String[] database = {"postgres", "sqladmin", "org.postgresql.Driver", "jdbc:postgresql://localhost:5432/banco73b2017"};
private Connection _pgsql;
INSERT INTO nivel_acesso VALUES(DEFAULT, 'Administrador');
INSERT INTO nivel_acesso VALUES(DEFAULT, 'Moderador');
INSERT INTO nivel_acesso VALUES(DEFAULT, 'Usuário');
INSERT INTO nivel_acesso VALUES(DEFAULT, 'Visitante');
INSERT INTO familia VALUES(DEFAULT, 'Alunos TCC', 'CTI - "Profº Isaac Portal Roldán"');
INSERT INTO familia VALUES(DEFAULT, 'Santos', 'Residência Bauru - Jd. Bela Vista');
INSERT INTO grupo VALUES(DEFAULT, 1, 'Admin');
INSERT INTO grupo VALUES(DEFAULT, 1, 'Gabriel');
INSERT INTO grupo VALUES(DEFAULT, 1, 'Gisele');
INSERT INTO grupo VALUES(DEFAULT, 1, 'Caio');
//int devs[] = {2, 3, 5, 6, 9, 10, 4};
int devs[] = {0, 6, 10, 9, 3, 5, 4, 0, 2};
int count = (sizeof(devs) / sizeof(int));
#include "DHT.h"
int DHTPIN = 11;
int DHTTYPE = DHT22;
@gabrielsaints
gabrielsaints / houzion.ino
Created October 4, 2018 00:59
arduino program
//int devs[] = {2, 3, 5, 6, 9, 10, 4};
int devs[] = {0, 6, 10, 9, 3, 5, 4, 0, 2};
int count = (sizeof(devs) / sizeof(int));
#include "DHT.h"
int DHTPIN = 11;
int DHTTYPE = DHT22;
DROP FUNCTION IF EXISTS GetTableContent(INTEGER);
DROP TABLE IF EXISTS registro;
DROP TABLE IF EXISTS permite_cena;
DROP TABLE IF EXISTS agendamento;
DROP TABLE IF EXISTS rotina;
DROP TABLE IF EXISTS cena;
DROP TABLE IF EXISTS permissao;
DROP TABLE IF EXISTS alerta;
DROP TABLE IF EXISTS controle;
DROP TABLE IF EXISTS ambiente;