Skip to content

Instantly share code, notes, and snippets.

@maxbraynner
maxbraynner / redis-docker-compose.yaml
Last active November 29, 2019 13:52
Dcoker compose para redis
version: '3'
services:
redis:
image: redis:5.0.7-alpine
command: ["redis-server", "--appendonly", "yes"]
hostname: redis
networks:
- redis-net
volumes:
- redis-data:/data
@maxbraynner
maxbraynner / pom.xml
Last active July 4, 2019 19:50
Spring REST
<?xml version="1.0" encoding="UTF-8"?>
<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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.4.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
@maxbraynner
maxbraynner / docker-compose.yml
Created February 5, 2019 23:19
Develope Postgres
version: '3.1'
services:
db_postgres:
image: postgres
restart: always
volumes:
- pgdata:/var/lib/postgresql/data
environment:
@maxbraynner
maxbraynner / docker-compose.yml
Created February 5, 2019 23:18
Develope MySQL
version: '3.1'
services:
db_mysql:
image: mysql
restart: always
command: --default-authentication-plugin=mysql_native_password
volumes:
- mysqldata:/var/lib/mysql
@maxbraynner
maxbraynner / .gitignore
Last active January 18, 2019 03:13
Git Ignore
######################
# Project Specific
######################
/build/www/**
/src/test/javascript/coverage/
/src/test/javascript/PhantomJS*/
######################
# Node
######################
@maxbraynner
maxbraynner / MegaSena.java
Last active December 28, 2018 00:30
Sorteia de 0 a 60. repete 50063860x e retorna os que mais repitiram.
import java.util.ArrayList;
import java.util.Iterator;
import java.util.NavigableSet;
import java.util.Random;
import java.util.Set;
import java.util.TreeMap;
public class MegaSena {
public void getNumeros(int repeticoes) {
@maxbraynner
maxbraynner / Jboss
Created December 16, 2018 01:03
Jboss DataSource
:::::::::::::::::::::::::::::::::::::
:: Configuração do modulo do MySQL ::
:::::::::::::::::::::::::::::::::::::
Crie pasta:
jboss-as-7.1.1.Final/modules/com/mysql/main
Para esta pasta copie os arquivos modules.xml e o JAR do driver do MySQL (dentro da pasta
resources/module-mysql).
@maxbraynner
maxbraynner / Dockerfile
Created August 17, 2018 15:40
Dockerfile for wildfly with postgres datasource
FROM jboss/wildfly:11.0.0.Final
ADD api.war /opt/jboss/wildfly/standalone/deployments/
ADD postgres /opt/jboss/wildfly/modules/system/layers/base/org/postgres
ADD standalone.xml /opt/jboss/wildfly/standalone/configuration/
ENV PORT=8080 TZ="America/Recife" LC_ALL="en_US.UTF-8" LANG="en_US.UTF-8" LANGUAGE="en_US.UTF-8"
EXPOSE $PORT
CMD /opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0 --server-config=standalone.xml -Djboss.http.port=$PORT