Skip to content

Instantly share code, notes, and snippets.

View danilobatistaqueiroz's full-sized avatar

Danilo Batista de Queiroz danilobatistaqueiroz

View GitHub Profile
@sirdantas
sirdantas / docker-compose.yml
Created August 13, 2020 17:29
Kong + Konga
version: "3.7"
volumes:
kong_data: {}
networks:
kong-net:
services:
@bradtraversy
bradtraversy / node_redis_cache.js
Created August 20, 2019 12:55
Node.js & Redis Caching
const express = require('express');
const fetch = require('node-fetch');
const redis = require('redis');
const PORT = process.env.PORT || 5000;
const REDIS_PORT = process.env.PORT || 6379;
const client = redis.createClient(REDIS_PORT);
const app = express();
@alexruzenhack
alexruzenhack / domain_driven_design.md
Last active December 31, 2023 12:13
Summary of #ddd by Eric Evans

The heart of software

  • Leaders within a team who understand the centrality of the domain can put their software project back on course.
  • Software developer is like a researche, both have the responsability to tackle the messiness of the real world through complicated domain that has never been formalized.
  • There are systematic ways of thinking that developers can employ to search for insight and produce effective models.

One. Crunching Knowledge

Ingredients of effective modeling

## Effective Java, 2nd Edition
by Joshua Bloch
*I, [Michael Parker](http://omgitsmgp.com/), own this book and took these notes to further my own learning. If you enjoy these notes, please [purchase the book](http://www.amazon.com/Effective-Java-Edition-Joshua-Bloch/dp/0321356683)!*
### Chapter 2: Creating and Destroying Objects
#### Item 1: Consider static factories instead of constructors
* An instance-controlled class is one that uses static factories to strictly control what instances exist at any time.

Persistent PostgreSQL inside Docker

source: https://crondev.com/persistent-postgresql-inside-docker/

Most recommended way to persist data inside docker is to create data only container. However to simplify things it is also possible just to mount a directory from the host and to use that location as persistent storage. Also, this way it is easy enough to dockerize existing Postgres installations.
For existing postgres installations here are some preparation steps (Ubuntu 14.04 with postgres 9.3):
Stop postgres if running:

sudo stop postgresql  
@dublado
dublado / Shell initialization files.md
Created September 26, 2018 18:38
Shell initialization files

Shell initialization files

3.1.1. System-wide configuration files

3.1.1.1. /etc/profile

When invoked interactively with the --login option or when invoked as sh, Bash reads the /etc/profile instructions. These usually set the shell variables PATH, USER, MAIL, HOSTNAME and HISTSIZE. On some systems, the umask value is configured in /etc/profile; on other systems this file holds pointers to other configuration files such as:

  • /etc/inputrc, the system-wide Readline initialization file where you can configure the command line bell-style.
@dublado
dublado / Refactoring | Mente iniciante.md
Last active January 14, 2020 16:36
Refactoring | Mente iniciante

Refatorar é bom para aprender OO

Uncle Bob blogou no Clean Coder sobre uns code reviews que ele fez do código (e das refatorações) de um cara chamado John MacIntyre.

Uncle Bob criticou a conclusão do cara de que refatoração não vale a pena para projetos reais: refatoração é uma maneira efetiva de evitar que o código apodreça e fique difícil de manter.

O que achei de mais interessante sobre o post do Uncle Bob é que ele pegou o código inicial do cara e foi fazendo pequenas refatorações, no estilo Baby Steps. No final, acabou melhorando drasticamente a estrutura do código e tornando-o muito mais extensível. O exemplo é bem pequeno mas, mesmo assim, houve uma melhora significativa.
O código inicial:

@frankrausch
frankrausch / change-speed-of-mp3.sh
Last active April 21, 2024 07:06
Slow down or speed up all MP3 files in a folder with FFmpeg.
#/bin/sh
speed="0.7"
mkdir "speed-${speed}x"
for f in *.mp3
do ffmpeg -i "$f" -filter:a "atempo=${speed}" "./speed-${speed}x/$f"
done
@kcranston
kcranston / postgres-jsonb.md
Last active April 24, 2024 16:59
intro to document stores in postgreSQL

Document stores in PostgreSQL

Notes for software engineering meeting presentation

What

  • mid to late 2000s: appearance of Document stores / NoSQL databases such as Mongo, Couch
  • Relational DBs now have support for document data: JSON in MySQL, JSON and JSONB in PostgreSQL
  • Focus on JSONB in Postgres (most full featured)