Skip to content

Instantly share code, notes, and snippets.

View steppat's full-sized avatar

Nico Steppat steppat

View GitHub Profile
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
class SevenDaysOfCodeJavaDay1 {
public static void main(String[] args) throws Exception {
String apiKey = "<sua chave>";
@steppat
steppat / persistence.xml
Created September 28, 2020 00:38
persistence.xml inicial do curso JPA
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="contas">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>br.com.alura.jpa.modelo.Conta</class>
@steppat
steppat / pom.xml
Created September 28, 2020 00:18
pom.xml inicial do curso JPA
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.alura.jpa</groupId>
<artifactId>projeto-jpa</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
CREATE TABLE ator
(
id_ator SERIAL PRIMARY KEY,
primeiro_nome VARCHAR(45) NOT NULL,
ultimo_nome VARCHAR(45) NOT NULL,
data_atualizado TIMESTAMP NOT NULL DEFAULT 'NOW()'
);
CREATE INDEX idx_ultimo_nome ON ator USING btree (ultimo_nome);
CREATE TABLE idioma
public class LeilaoSteps implements io.cucumber.java8.Pt{
private LoginPage loginPage;
private LeiloesPage leiloesPage;
private NovoLeilaoPage novoLeilaoPage;
private Browser browser;
public LeilaoSteps() {
Dado("um usuario logado", () -> {
this.browser = new Browser();
!/bin/sh
echo fs.inotify.max_user_instances=524288 | tee -a /etc/sysctl.conf && sysctl -p
echo 999 | tee -a /proc/sys/fs/inotify/max_user_instances
echo 99999 | tee -a /proc/sys/fs/inotify/max_queued_events
echo 99999 | tee -a /proc/sys/fs/inotify/max_user_watches
@steppat
steppat / gist:dcbbb828efaec152e9bbe460ab2d2634
Created February 22, 2019 19:26
Teste conexao PHP MySQL
<?php
echo "Testando conexao <br /> <br />";
$servername = "192.168.1.24";
$username = "phpuser";
$password = "pass";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
@steppat
steppat / phpweb.pp
Created February 22, 2019 19:20
Simple Puppet Manifest PHP Installation Script
# execute 'apt-get update'
exec { 'apt-update': # exec resource named 'apt-update'
command => '/usr/bin/apt-get update' # command this resource will run
}
package { ['php7.2' ,'php7.2-mysql'] :
require => Exec['apt-update'],
ensure => installed,
}
-- mysql -u root < create-db.sql
-- MySQL dump 10.13 Distrib 5.5.59, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: classloader
-- ------------------------------------------------------
-- Server version 5.5.59-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;