Skip to content

Instantly share code, notes, and snippets.

My Typescript solution
@jeffersontpadua
jeffersontpadua / Counter.js
Created October 25, 2019 13:12
Count to a certain number
const Counter = {
handler: null,
end: 5,
seconds: 0,
start: () => {
if (Counter.handler) {
clearInterval(Counter.handler);
Counter.seconds = 0;
}
@jeffersontpadua
jeffersontpadua / banco.sql
Created May 29, 2019 22:22
Banco de dados simples com tabela de produtos
CREATE DATABASE IF NOT EXISTS `aula-php` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `aula-php`;
-- MySQL dump 10.13 Distrib 5.7.26, for Linux (x86_64)
--
-- Host: localhost Database: aula-php
-- ------------------------------------------------------
-- Server version 5.7.26-0ubuntu0.19.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
<html>
<head>
<link rel="stylesheet" href="index.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
</head>
<body>
<div id="urna">
<form method="POST">
const candidatoVotado = document.getElementById('candidato-votado');
const identificacaoVoto = document.getElementById('identificacao-voto');
const corrigir = document.getElementById('corrigir');
const confirmar = document.getElementById('confirmar');
const fotoCandidato = document.getElementById('foto-candidato');
const form = document.getElementById('formulario');
if(!candidatoVotado) {
throw new Error('Nenhum input com o id candidato-votado adicionado');
}
@jeffersontpadua
jeffersontpadua / Server.js
Last active February 3, 2019 18:05
Iniciando aplicação com Node.js, Express e Babel 7
import Express from 'express';
export class Server {
app = Express();
startup() {
this.setupRoutes();
this.app.listen(3000, () => console.log("Listening..."));
}
@jeffersontpadua
jeffersontpadua / App.tsx
Last active January 5, 2019 13:34
Componente para entrada de texto
import { EntradaTexto } from './EntradaTexto';
class App extends Component {
render() {
return (
<div className="App">
<EntradaTexto />
</div>
);
}
@jeffersontpadua
jeffersontpadua / Main.java
Created December 3, 2018 20:09
Força Bruta
import java.util.*;
class Main {
public static void main(String[] args) {
String palavra = "book";
List<Character> letras = new ArrayList<>();
for(char letra = 'a'; letra <= 'z'; letra++) {
letras.add(letra);
@jeffersontpadua
jeffersontpadua / ConexaoMySQL.java
Last active November 27, 2018 20:21
Conexão com MySQL em Java
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author JEFFERSON
*/
@jeffersontpadua
jeffersontpadua / tslint.json
Created November 13, 2018 11:09
Lints para Typescript
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended",
],
"jsRules": {},
"rules": {
"semicolon": [
true,
"never"