Skip to content

Instantly share code, notes, and snippets.

View aristotelesbr's full-sized avatar
🏠
Working from home

Aristóteles Coutinho aristotelesbr

🏠
Working from home
View GitHub Profile
...
** Execute deploy
** Invoke deploy:starting (first_time)
** Execute deploy:starting
** Invoke deploy:check (first_time)
** Execute deploy:check
** Invoke git:check (first_time)
** Invoke git:wrapper (first_time)
** Execute git:wrapper
00:00 git:wrapper
@aristotelesbr
aristotelesbr / VagrantFile.rb
Created September 26, 2017 09:49
VagrantFile
RUBY_VERSION="2.4.0"
RAILS_VERSION="5.0.2"
MYSQL_PASSWORD="123456"
GIT_USER_NAME="Costa Nonato"
GIT_USER_EMAIL="[email protected]"
NODE_VERSION="6"
echo
@aristotelesbr
aristotelesbr / NERDTree.mkd
Created September 7, 2018 18:56 — forked from m3nd3s/NERDTree.mkd
My Vim Cheat Sheet

NERDTree

o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|

O.......Recursively open the selected directory..................|NERDTree-O|

@aristotelesbr
aristotelesbr / sutup.rb
Last active September 20, 2018 20:14
Configurando o ambiente de desenvolvimento Ruby on Rails no Linux com Rbenv (Linux Mint)
# Link para o video
# https://youtu.be/LnIWld2uZ-E
# Adicionando repósitorios NODE e YARN'''
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
# Instalando algumas dependencias
@aristotelesbr
aristotelesbr / class_example.rb
Last active October 9, 2018 00:48
Example for post (working with modules from Ruby)
class A
def foo
'foo'
end
def bar
'bar'
end
end
@aristotelesbr
aristotelesbr / module_example.rb
Last active October 9, 2018 00:50
module example
# Module.rb
module Account
def default_attributes
super.merge(common_attributes)
end
def common_attributes
{
name: '',
state: '',
@aristotelesbr
aristotelesbr / prepend_example.rb
Last active October 9, 2018 01:00
Last example
class AccountUser
prepend Account
def default_attributes
{
cpf: ''
}
end
end
class AccountStore

Reset mysql root password in Mac OS:

First Stop MySQL:

  1. Go to: 'System Preferences' >> 'MySQL' and stop MySQL

OR,

  1. sudo /usr/local/mysql/support-files/mysql.server start
  2. sudo /usr/local/mysql/support-files/mysql.server stop
# frozen_string_literal: true
class Customer
attr_reader :name, :document, :email, :address
def initialize(first_name, last_name, document, email, address)
@name = ValueObjects::Name.new(first_name, last_name)
@document = document
@email = email
@address = address
@aristotelesbr
aristotelesbr / create_recipe.ex
Created June 6, 2020 15:48
Como renderizar dados associados
defmodule RecipeBox.CreateRecipe do
@moduledoc """
Create a new Recipe
"""
import Ecto.Changeset
alias RecipeBox.{Recipe, Repo}
def run(params) do
%Recipe{}