Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

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

ryanjeff lrjbrual

🏠
Working from home
View GitHub Profile
@lrjbrual
lrjbrual / Gemfile
Created September 21, 2021 19:18
Can't locate the stimulus_reflex NPM package.
source 'https://rubygems.org'
git_source(:github) {|repo| "https://github.com/#{repo}.git" }
gem 'aws-sdk-s3', require: false
gem 'bootsnap', '>= 1.4.4', require: false
gem 'cancancan'
gem 'devise'
gem 'devise_invitable', '~> 2.0', '>= 2.0.5'
gem 'jbuilder', '~> 2.7'
gem 'pg'
Specs:
gem 'rails', '~> 6.1.3', '>= 6.1.3.2'
Ruby 3.0.1
gem 'webpacker', '~> 5.0'
## package.json
"stimulus": "^2.0.0",
"stimulus_reflex": "3.4.1",
<div class="content">
<div class="row">
<div class="col-md-10 ml-auto mr-auto">
<div class="card card-user">
<div class="card-header">
<div class="row">
<div class="col-md-6 col-sm-12">
<h5 class="card-title">Update Invoice</h5>
<small><b>Invoice No.</b>01234</small><br>
<small><b>Invoice Type: </b>Travel Expenses</small>
require("@rails/ujs").start()
require("turbolinks").start()
require("@rails/activestorage").start()
require("channels")
require("trix")
require("@rails/actiontext")
import '../stylesheets/application'
@lrjbrual
lrjbrual / webpacker_rails.md
Created March 23, 2020 10:15 — forked from maxivak/webpacker_rails.md
Webpack, Yarn, Npm in Rails
@lrjbrual
lrjbrual / letsencrypt_2019.md
Created July 1, 2019 08:03 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@lrjbrual
lrjbrual / heroku_pg_db_reset.md
Created June 4, 2019 16:31 — forked from zulhfreelancer/heroku_pg_db_reset.md
How to reset PG Database on Heroku?

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

heroku restart; heroku pg:reset DATABASE --confirm APP-NAME; heroku run rake db:migrate

@lrjbrual
lrjbrual / contact-form.md
Created May 20, 2019 07:07 — forked from stevecondylios/contact-form.md
Create and Deploy a Contact Form to Production in Rails 5

Create a Contact Form in Rails 5

This is a complete, step-by-step tutorial showing how to create a fully functional contact form in production in rails 5. Rather than reinvent things, the following borrows from the best available documentation and tutorials (most notably, this tutorial on making a contact form in development). The finished contact form can be viewed here.

This tutorial uses:

  • heroku for deployment,
  • gmail for the mailer, and
  • github for version control

It would be a good idea to create a new gmail account to use for your mailer now, if you haven't already. If you haven't yet got a heroku account and installed the heroku CLI, it would be easiest to do so now.

@lrjbrual
lrjbrual / Capistrano-Deployment-Recipe.rb
Created August 27, 2018 14:41 — forked from mrrooijen/Capistrano-Deployment-Recipe.rb
a "base" Capistrano Rails Deployment Recipe. Use it to deploy your Rails application. It is also easily expandable. So feel free to grab this Recipe and add your own tasks/customization!
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
@lrjbrual
lrjbrual / digitalocean.md
Created July 19, 2018 11:45 — 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 root@123.123.123.123

Add ssh fingerprint and enter password provided in email