Skip to content

Instantly share code, notes, and snippets.

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

Diego Novais dnovais

🏠
Working from home
View GitHub Profile
@dnovais
dnovais / fila.rb
Last active October 26, 2022 17:46
fila
class Queue
def initialize()
@queue = []
end
def enqueue(value)
@queue.push(value)
end
def dequeue()
@dnovais
dnovais / postgresql_configuration_on_ubuntu_for_rails.md
Created June 25, 2020 00:34 — forked from p1nox/postgresql_configuration_on_ubuntu_for_rails.md
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
@dnovais
dnovais / fix-error-fatal-role-postgres-does-not-exist.md
Created March 30, 2020 14:26
Fixing error - psql: FATAL: role “postgres” does not exist

Corrigindo o erro psql: FATAL: role “postgres” does not exist

1 - Instalar o postgresql

brew install postgresql

2 - Startar o postgresql

@dnovais
dnovais / oh-my-zsh-insecure-completion-dependent.md
Last active March 30, 2020 14:15
Fixing error: oh-my-zsh Insecure completion-dependent

Corrigindo o erro de segurança do oh-my-zsh:

  • "oh-my-zsh Insecure completion-dependent directories detected"

Basta rodar os comandos:

sudo chmod g-w /usr/local/share/zsh /usr/local/share/zsh/site-functions
sudo chmod o-w /usr/local/share/zsh /usr/local/share/zsh/site-functions
@dnovais
dnovais / fix-error-cant-find-bundler.md
Created March 30, 2020 13:21
Fixing the error: can't find gem bundler (>= 0.a)

Corrigindo o erro: can't find gem bundler (>= 0.a)

Para corrigir o erro basta instalar a gem bundler pegando a versão especifica que contem no Gemfile.lock

gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"
@dnovais
dnovais / dokku-digitalocean.md
Created August 27, 2019 01:57 — forked from aurelioluiz/dokku-digitalocean.md
Aplicação Rails com Dokku na DigitalOcean

Aplicação Rails com Dokku na DigitalOcean

Etapas para configuração de uma aplicação em Rails na DigitalOcean usando o Dokku para deploy. A documentação completa está disponível em http://dokku.viewdocs.io/dokku/getting-started/installation

Requisitos

  • DigitalOcean droplet Ubuntu 18.04
  • Dokku 1-click installation
  • Aplicação Rails no GitHub
@dnovais
dnovais / overview_mongodb.md
Created May 8, 2019 20:14
Overview a respeito do MongoDB

Um overview a respeito do MongoDB

  • Um banco de dados não relacional;
  • Sem o uso de SQL (No SQL);
  • A sintax é diferente;
  • De alto desempenho;
  • Sem migrates;
  • Não existe schema;

O termo NOSQL surgiu por Carlo Strozzi em 1998 e depois veio a resurgir em 2009 com Eric Evans.

@dnovais
dnovais / fix_error_cant_find_gem_bundler.md
Created January 11, 2019 13:43
Fix error can't find gem bundler
  • can't find gem bundler
  • gem install bundler -v '~> 1.17.1'
@dnovais
dnovais / fix_rmagick_problem_mac.md
Created January 11, 2019 10:56
Fix problem with rmagick on Mac Os
  • brew unlink imagemagick
  • brew install imagemagick@6 && brew link imagemagick@6 --force
  • echo 'export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"' >> ~/.bash_profile
@dnovais
dnovais / fix_brew_macos.md
Last active December 13, 2018 11:39
Fix brew problems - MacOs
  • brew doctor
  • brew upgrade
  • brew cleanup