Skip to content

Instantly share code, notes, and snippets.

View gtoroap's full-sized avatar
💭
Coding

Gustavo Toro gtoroap

💭
Coding
View GitHub Profile
@gtoroap
gtoroap / "torn" 1 Setup vps.md
Created April 24, 2024 15:12 — forked from deHelden/"torn" 1 Setup vps.md
Deploy Rails 7.0.4.2 to VPS(DigitalOcean Ubuntu 20). Nginx, Puma, Capistrano3, PostgreSQL, Rbenv.

SETUP VPS

based on DigitalOcean guide

Create local project

local$ rails new appname -T -d postgresql
local$ rails g scaffold Story title:string body:text
local$ rails db:migrate
@gtoroap
gtoroap / array_flatten.rb
Last active August 6, 2019 16:13
My own implementation of Array#flatten
class ArrayFlatten
def initialize(arr)
@arr = arr
end
def flatten(level = nil)
_flatten(@arr, 0, level)
end
private