Skip to content

Instantly share code, notes, and snippets.

View mariorez's full-sized avatar

Mario Rezende mariorez

View GitHub Profile
@mariorez
mariorez / gist:cc166ac47e9a3ab5b89d08c6be1c57f3
Created August 23, 2017 17:03 — forked from SzymonPobiega/gist:5220595
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht
@mariorez
mariorez / configure_docker0.sh
Created January 31, 2017 12:42
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
#
# You can run this script directly from github as root like this:
# curl -sS https://gist.githubusercontent.com/fabiorphp/a94e0ea2558b3d10185d6d69d053c2b2/raw/configure_docker0.sh | sudo bash -s - 172.31.0.21/16
#
# * Make sure you replace "192.168.254.0/24" with the network that you want to use
#
# NOTE: This script is intended for Debian / Ubuntu only!
if [ $# -lt 1 ]; then
### GIT DIRTY
source /usr/share/git/completion/git-prompt.sh
function _git_prompt() {
local git_status="`git status -unormal 2>&1`"
if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then
if [[ "$git_status" =~ nothing\ to\ commit ]]; then
local signal='\[\e[0;1;32m\] ✔\[\e[0m\]'
elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then
local signal='\[\e[0;1;31m\] ✘\[\e[0m\]'
@mariorez
mariorez / gist:060ad802b554babb80b5
Created October 21, 2015 14:30 — forked from ngocdaothanh/gist:3764694
Scala Assignment: Recursion
package recfun
import scala.collection.mutable.ListBuffer
import common._
/** https://class.coursera.org/progfun-2012-001/assignment/view?assignment_id=4 */
object Main {
def main(args: Array[String]) {
println("Pascal's Triangle")
for (row <- 0 to 10) {
# Execute command as user
function uexec {
if [ $# -eq 1 ]; then
eval "(su - '$1')"
fi
if [ $# -eq 2 ]; then
eval "(su - '$1' -c '${2}')"
fi
}
# Paste this function in your ".bashrc" to enable the "pomo" command in your terminal
# POMODORO Terminal:
function pomo {
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo -e "POMODORO Terminal\n"
echo "usage: pomo 25 minutes timeout"
echo -e " or: pomo [options] see options below\n"
echo "Options:"
echo " short: 05 minutes timeout"
echo " long: 15 minutes timeout"
#To watch the contents of a directory change
watch -d ls -l
Disable Touchpad
=======================================
xinput list
xinput set-prop 15 "Device Enabled" 0
Stop screen going black after 10 min
=======================================
Type on terminal: xset s 0 0
Or add this command in: home/username/.profile
[program:tomcat6]
command=/opt/tomcat6-instance/bin/supervisor-wrapper.sh

Keybase proof

I hereby claim:

  • I am mariorez on github.
  • I am mariorez (https://keybase.io/mariorez) on keybase.
  • I have a public key whose fingerprint is 0AC2 0708 9FE2 2A94 F8DC 8B7A FCC5 AD68 453F 0A1A

To claim this, I am signing this object: