Skip to content

Instantly share code, notes, and snippets.

View alexishida's full-sized avatar
👨‍💻
Coding

Alex Ishida alexishida

👨‍💻
Coding
View GitHub Profile
@alexishida
alexishida / docker-postgres-pgadmin4.txt
Last active February 8, 2018 00:50
Docker postgres and pgadmin4
docker run -d \
--name=postgres \
--restart=always \
-p 5432:5432 \
-v /etc/localtime:/etc/localtime:ro \
-e POSTGRES_USER=user \
-e POSTGRES_PASSWORD=mysecretpassword \
-v /storage/postgres:/var/lib/postgresql/data \
postgres:latest
@alexishida
alexishida / nginx-redirect.txt
Created November 6, 2017 17:18
Redirecionamento de dominios com nginx
server {
listen 80;
server_name seusite.com;
return 301 http://www.seusite.com$request_uri;
}
server {
@alexishida
alexishida / linux-commands.txt
Last active October 20, 2025 17:51
Comandos Linux
# Definiro o ZSH como terminal padrao
chsh -s $(which zsh)
# Symbolic Link
ln -s <source> <target>
# Ubuntu configure locale e timezone
sudo dpkg-reconfigure locales
sudo dpkg-reconfigure tzdata
VBoxManage modifyvm <vmname> --hwvirtex off
@alexishida
alexishida / nginx.conf
Last active February 20, 2023 07:58 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
# Advanced config for NGINX
server_tokens off;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
@alexishida
alexishida / comandos-ruby-rails-exemplos.txt
Last active February 24, 2025 13:39
Comandos Ruby e Rails
# Removendo o carregamento onhover de links
<meta name="turbo-prefetch" content="false">
# Method Delete link_to no turbo
<%= link_to logout_path, class: "nav-link", data: { turbo_method: :delete, turbo: true } do %>
# COMANDOS
rails new appname -d postgresql
rails new appname --api
@alexishida
alexishida / _notificacoes.html.erb
Created March 12, 2018 16:45
flahs notifications bootstrap rails
<% if notice || alert %>
<% t = 'success' if notice %>
<% t = 'danger' if alert %>
<%
if notice && notice.split('^')[0] == 'warning'
t = 'warning'
m = notice.split('^')[1]
else
m = notice || alert
end
@alexishida
alexishida / ubuntu-on-windows-10.txt
Created March 13, 2018 03:01
Ubuntu on Windows 10
# https://docs.microsoft.com/en-us/windows/wsl/install-win10
1 - Open PowerShell as Administrator and run:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
2 - Restart your computer when prompted.
@alexishida
alexishida / letsencrypt-certbot-manual.txt
Last active November 6, 2018 04:37
Manual Letsencrypt Certbot
# Link de Referência
https://certbot.eff.org/
https://certbot.eff.org/docs/
# Install
On Ubuntu systems, the Certbot team maintains a PPA. Once you add it to your list of repositories all you'll need to do is apt-get the following packages.
$ sudo apt-get update
@alexishida
alexishida / rails-production.txt
Last active June 18, 2019 07:35
rails in production
# Bash start.sh para inicialização da aplicação Rails >= 5.2
https://gist.github.com/alexishida/96ab6138caeb63a68e96a0bb1bf58c15
# Gerando o banco
RAILS_ENV=production rails db:create
RAILS_ENV=production rails db:migrate
RAILS_ENV=production rails db:seed
# Gerando os assets
RAILS_ENV=production rails assets:precompile