Skip to content

Instantly share code, notes, and snippets.

@ismarsantos
ismarsantos / VSCODE_LAUNCH.md
Created August 9, 2021 23:28 — forked from nicolasrouanne/VSCODE_LAUNCH.md
VS Code configuration: settings & debugger config (Ruby, React)

VS Code launch.json configurations

VS Code launch.json file serves as a debugging configuration file.

Introduction

Where to put it

It must be stored in PROJET_ROOT/.vscode/launch.json.

Should I commit it?

Though opinions vary, it is not recommended to commit such files in source control. It is specific to every developer, and commiting it would prevent each developer to configure it according to his needs.

Note: this assumes you are using ZSH shell.
## Installation
Install [asdf](https://github.com/asdf-vm/asdf):
```
$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.0
$ echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
$ echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
@ismarsantos
ismarsantos / 01. Gemfile
Created August 12, 2021 00:29 — forked from schleg/01. Gemfile
Setup for Devise + Omniauth
gem 'pg'
group :development do
gem 'ruby-debug'
end
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'
@ismarsantos
ismarsantos / pgadmin.txt
Last active September 2, 2024 17:37
Connect PgAdmin4 on WSL2 Ubuntu 20.04.3 LTS
sudo -u postgres psql -c 'SHOW config_file'
sudo nano /etc/postgresql/13/main/postgresql.conf
# uncomment line 59:
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------
# - Connection Settings -
@ismarsantos
ismarsantos / digitalocean.md
Created August 19, 2021 18:05 — forked from jentanbernardus/digitalocean.md
Setup instructions for Digital Ocean VPS using Ubuntu and Rails 3.2 #digitalocean #vps #setup

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create Droplet

Create droplet of your liking (ubuntu 12.04 x32) Use an xx.04 LTS version

Setup DNS

On Digital Ocean, create a DNS entry for your server (xyz.com)

Make sure it has NS records that use digital oceans nameservers

@ismarsantos
ismarsantos / digitalocean.md
Created August 19, 2021 18:05 — forked from JamesDullaghan/digitalocean.md
Deploy rails app to digitalocean with nginx, unicorn, capistrano & postgres

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh [email protected]

Add ssh fingerprint and enter password provided in email

@ismarsantos
ismarsantos / gist:b107e499291770ff90e46b39611ed422
Created August 19, 2021 18:07 — forked from hhff/gist:158a3ac397eb66df6a98
Setting up Spree on Dokku via Digital Ocean
Spree API Server Needs
- Easy Setup & Deployment (Dokku)
- New Relic
- Error Monitoring (Raven)
- Performance Monitoring (Skylight)
- Logging (Loggly or Logentries?)
- SSL (Dokku handles this)
- Database Backups (http://donpottinger.net/blog/2014/11/22/bye-bye-heroku-hello-dokku-part-2.html (See Clockwork section))
- Caching (Memcached + Dalli)
- Worker (Sidekiq)
@ismarsantos
ismarsantos / rbenv-deploy.sh
Created August 22, 2021 23:57 — forked from ipoerner/rbenv-deploy.sh
Shell script to deploy rbenv w/ ruby-build plugin
#!/bin/sh
set -e # Exit script immediately on first error.
set -x # Print commands and their arguments as they are executed.
# Update Debian package index.
sudo apt-get update -y
# Install required Debian packages.
sudo apt-get install -y build-essential git-core wget zlib1g-dbg libssl-dev libreadline-dev libopenssl-ruby
#!/bin/sh
set -e # Exit script immediately on first error.
set -x # Print commands and their arguments as they are executed.
# Update Debian package index.
sudo apt-get update -y
# Install required Debian packages.
sudo apt-get upgrade -y
class AddRecordUuidToActiveStorageAttachments < ActiveRecord::Migration[5.2]
def change
# After applying this migration, you'll need to manually go through your
# attachments and populate the new `record_uuid` column.
# If you're unable to do this, you'll probably have to delete all your attachments.
# You've pretty much got useless garbage data if that's the case :(
add_column :active_storage_attachments, :record_uuid, :uuid
end
end