Skip to content

Instantly share code, notes, and snippets.

View danilobatistaqueiroz's full-sized avatar

Danilo Batista de Queiroz danilobatistaqueiroz

View GitHub Profile
@elgalu
elgalu / dconf-custom-keybindings.sh
Created January 22, 2016 14:38
Sample custom key bindings through dconf-tools cli
# requirements
sudo apt-get install -qyy dconf-tools
# careful, if you already have custom hotkeys this commands will overwrite the first 7 ...
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/name "'SouthWest(7)0,1080'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding "'<Primary><Super>a'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/command "'wmctrl -r :ACTIVE: -e 7,0,1080,-1,-1'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/name "'SouthEast(9)1920,1080'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/binding "'<Primary><Super>d'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/command "'wmctrl -r :ACTIVE: -e 9,1920,1080,-1,-1'"

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:

@bzerangue
bzerangue / disable-suspend.md
Last active January 8, 2021 11:19
Disable Sleep/Suspend and WiFi in Ubuntu 16.04 LTS

On Ubuntu 16.04 LTS, I successfully used the following to disable suspend:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

And this to re-enable it:

sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

@deanhunt
deanhunt / fowler.md
Last active May 18, 2023 18:56
Notes from Martin Fowler's "Refactoring"

Refactoring, Fowler

http://martinfowler.com/books/refactoring.html

Five or six years ago I was working on an essay about refactoring CSS. I didn't do that, but I did find these notes while working on something new. Hope they're useful! —Dean

p7 "When you find you have to add a feature to a program, and the program's code is not structured in a convenient way to add the feature, first refactor the program to make it easy to add the feature, then add the feature."

p7

@sirdantas
sirdantas / docker-compose.yml
Created August 13, 2020 17:29
Kong + Konga
version: "3.7"
volumes:
kong_data: {}
networks:
kong-net:
services:
@sdieunidou
sdieunidou / rabbitmq.txt
Created October 22, 2015 19:51
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@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