Skip to content

Instantly share code, notes, and snippets.

View flaugabriel's full-sized avatar
👨‍💻
Full Stack Developer

Gabriel Flauzino Mota flaugabriel

👨‍💻
Full Stack Developer
View GitHub Profile
@mlanett
mlanett / rails http status codes
Last active July 22, 2024 09:14
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@randallreedjr
randallreedjr / heroku-remote.md
Last active April 25, 2024 07:06
Add a Heroku remote to an existing git repo

Working with git remotes on Heroku

Generally, you will add a git remote for your Heroku app during the Heroku app creation process, i.e. heroku create. However, if you are working on an existing app and want to add git remotes to enable manual deploys, the following commands may be useful.

Adding a new remote

Add a remote for your Staging app and deploy

Note that on Heroku, you must always use master as the destination branch on the remote. If you want to deploy a different branch, you can use the syntax local_branch:destination_branch seen below (in this example, we push the local staging branch to the master branch on heroku.

$ git remote add staging https://git.heroku.com/staging-app.git
@diegobarros0701
diegobarros0701 / ror-nginx-unicorn.md
Created November 5, 2017 00:40
RoR with Nginx and Unicorn

Nginx configuration

Add the following code in nginx.conf, inside http block

upstream rails {
  # Path to Unicorn socket file
  server unix:/home/username/project_name/shared/sockets/uni$
}
@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
@alexishida
alexishida / s3-minio-nginx.conf
Created July 4, 2018 13:40
Nginx Minio S3 config
server {
listen 80;
server_name s3.exemplo.com;
client_max_body_size 20000M;
location / {
proxy_buffering off;
proxy_set_header Host $http_host;
@alexishida
alexishida / config-assets-js-css-turbolinks-rails.txt
Last active June 8, 2020 21:27
Config de Assets Javascript Vendor Turbolinks no Rails
@asssis
asssis / install rails
Last active August 9, 2023 15:40 — forked from alexishida/rbenv-ruby-rails-install.sh
Install rbenv, ruby and rails (executar como root)
#ATUALIZAR RUBY
cd /usr/local/rbenv
git reset --hard
git pull origin master
cd ~/.rbenv/plugins/ruby-build
git reset --hard
git pull origin master
# - Listando versoes existentes
@alexishida
alexishida / rbenv-ruby-rails-update.sh
Last active July 23, 2024 02:43
Script to update rbenv, Ruby and Ruby on Rails versions
#!/bin/bash
#---------------------------------------------------------------------------------------
# Script to update rbenv, Ruby and Ruby on Rails versions
# Source: https://gist.github.com/alexishida/015b074ae54e1c7101335a2a63518924
#
# Author: Alex Ishida <alexishida@gmail.com>
# Version: 1.6.1 - 22/07/2024
#---------------------------------------------------------------------------------------
#
# If you want install rbenv for the first time
@oliveira-andre
oliveira-andre / run docker redis
Last active November 12, 2019 00:25
run docker redis
sudo docker run -d \
--name=redis \
--restart=always \
-v redis:/var/lib/redis/data \
-p 6379:6379 \
redis:latest
@alexishida
alexishida / ruby-security.txt
Last active June 2, 2023 13:54
Ruby Security rails rubocop brakeman
# Commands
gem install bundler-audit
bundle audit check --update
gem install brakeman
brakeman
gem install rubycritic
rubycritic