Skip to content

Instantly share code, notes, and snippets.

require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
def create
user = User.create(user_params)
if user.valid?
WelcomeMailer.welcome(user).deliver_later
session[:current_user] = user.id
return render json: user, status: 201
else
return render json: { error: user.errors.full_messages }, status: 404
end
end
@m-delc
m-delc / gist:47bdb9d7339efe88ba6b88243a9d1988
Created June 1, 2022 04:06
active_mailer_console_readout
[ActiveJob] [ActionMailer::MailDeliveryJob] [6ee6f60c-a531-4118-a6aa-95f486ff6d4b] Rendering layout layouts/mailer.html.erb
[ActiveJob] [ActionMailer::MailDeliveryJob] [6ee6f60c-a531-4118-a6aa-95f486ff6d4b] Rendering welcome_mailer/welcome.html.erb within layouts/mailer
[ActiveJob] [ActionMailer::MailDeliveryJob] [6ee6f60c-a531-4118-a6aa-95f486ff6d4b] Rendered welcome_mailer/welcome.html.erb within layouts/mailer (Duration: 0.5ms | Allocations: 435)
[ActiveJob] [ActionMailer::MailDeliveryJob] [6ee6f60c-a531-4118-a6aa-95f486ff6d4b] Rendered layout layouts/mailer.html.erb (Duration: 0.8ms | Allocations: 686)
[ActiveJob] [ActionMailer::MailDeliveryJob] [6ee6f60c-a531-4118-a6aa-95f486ff6d4b] Rendering layout layouts/mailer.text.erb
[ActiveJob] [ActionMailer::MailDeliveryJob] [6ee6f60c-a531-4118-a6aa-95f486ff6d4b] Rendering welcome_mailer/welcome.text.erb within layouts/mailer
[ActiveJob] [ActionMailer::MailDeliveryJob] [6ee6f60c-a531-4118-a6aa-95f486ff6d4b] Rendered welcome_mailer/welcome.text.erb w
From: ****@gmail.com
To: ****@gmail.com
Message-ID: <6279eaeeb6be1_42c0a2abc21873@mx.mail>
Subject: Welcome to ****!
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_6279eaeeb5dd9_42c0a2abc2175b";
charset=UTF-8
Content-Transfer-Encoding: 7bit
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file. A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms:
2022-05-04 11:04:46.244 CDT [4277] LOG: starting PostgreSQL 14.2 on x86_64-apple-darwin20.6.0, compiled by Apple clang version 13.0.0 (clang-1300.0.29.30), 64-bit
2022-05-04 11:04:46.245 CDT [4277] LOG: could not bind IPv6 address "::1": Address already in use
2022-05-04 11:04:46.245 CDT [4277] HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2022-05-04 11:04:46.245 CDT [4277] LOG: could not bind IPv4 address "127.0.0.1": Address already in use
2022-05-04 11:04:46.245 CDT [4277] HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2022-05-04 11:04:46.245 CDT [4277] WARNING: could not create listen socket for "localhost"
2022-05-04 11:04:46.245 CDT [4277] FATAL: could not create any TCP/IP sockets
2022-05-04 11:04:46.246 CDT [4277] LOG: database system is shut down
abbrev (default: 0.1.0)
actioncable (7.0.2.4, 7.0.2.2)
actionmailbox (7.0.2.4, 7.0.2.2)
actionmailer (7.0.2.4, 7.0.2.2, 5.0.0.1)
actionpack (7.0.2.4, 7.0.2.2, 5.2.7.1, 5.0.0.1)
actiontext (7.0.2.4, 7.0.2.2)
actionview (7.0.2.4, 7.0.2.2, 5.2.7.1, 5.0.0.1)
active_model_serializers (0.10.13, 0.10.2)
activejob (7.0.2.4, 7.0.2.2, 5.0.0.1)
activemodel (7.0.2.4, 7.0.2.2, 6.1.4, 5.2.7.1)
import { useAtom } from "jotai";
import { alphabetAtom } from "../State.jsx";
// Returns warning: "Invalid Hook Call"
const [, setAlphabet] = useAtom(alphabetAtom);
export const fetchAlphabet = async () => {
const data = await fetch("http://localhost:3000/alphabets");
const json = await data.json();
setAlphabet(json);
Plan: Hobby-dev
Status: Available
Connections: 0/20
PG Version: 13.6
Created: 2022-03-10 15:57 UTC
Data Size: 8.3 MB/1.00 GB (In compliance)
Tables: 7
Rows: 28/10000 (In compliance)
Fork/Follow: Unsupported
Rollback: Unsupported
2022-03-10T08:34:55.416966+00:00 heroku[router]: at=info method=GET path="/static/js/main.d9d3b6b7.js" host=evening-scrubland-38980.herokuapp.com request_id=18bb1892-485c-4132-96f2-b94110277809 fwd="152.36.145.1" dyno=web.1 connect=0ms service=2ms status=404 bytes=177 protocol=https
2022-03-10T08:34:55.417054+00:00 app[web.1]: I, [2022-03-10T08:34:55.417003 #4] INFO -- : [299238af-7a20-474b-b588-552ed2685030] Started GET "/static/css/main.df49cf35.css" for 152.36.145.1 at 2022-03-10 08:34:55 +0000
2022-03-10T08:34:55.417280+00:00 heroku[router]: at=info method=GET path="/static/css/main.df49cf35.css" host=evening-scrubland-38980.herokuapp.com request_id=299238af-7a20-474b-b588-552ed2685030 fwd="152.36.145.1" dyno=web.1 connect=0ms service=2ms status=404 bytes=177 protocol=https
2022-03-10T08:34:55.417551+00:00 app[web.1]: F, [2022-03-10T08:34:55.417515 #4] FATAL -- : [299238af-7a20-474b-b588-552ed2685030]
2022-03-10T08:34:55.417552+00:00 app[web.1]: [299238af-7a20-474b-b588-552ed2685030] ActionController::Ro