As configured in my dotfiles.
start new:
tmux
start new with session name:
# frozen_string_literal: true | |
require 'rodauth' | |
# In order for Rails to reload this constant in dev, we need `require_dependency` because Rodauth expects the features | |
# in a specific load path, but it defines a constant against Rails' expectations, which breaks reloading. | |
require_dependency 'rodauth/features/remote_ip' | |
module Rodauth | |
Feature.define(:migrate_from_devise, :MigrateFromDevise) do |
require 'rodauth' | |
module Rodauth | |
# Clean up how we configure all of our tables, columns, etc., to use values which are more consistent with Rails than | |
# the defaults as well as use Rails mailers | |
Feature.define(:rails_conventions, :RailsConventions) do | |
depends :rails # rodauth-rails feature | |
def post_configure | |
# Rodauth uses dash-separated paths by default, so we'll make these underscores by default |
# frozen_string_literal: true | |
module Authentication | |
# Rodauth is pretty coupled to being in a request context, but this will provide the minimum necessary to be able | |
# to generate correct URLs | |
def self.rodauth(configuration_name = :user, params: {}) | |
url_options = Rails.application.config.action_mailer.default_url_options | |
host = url_options[:host] | |
host += ":#{url_options[:port]}" if url_options.key?(:port) | |
base_url = "#{url_options[:protocol] || 'http'}://#{host}" |
As configured in my dotfiles.
start new:
tmux
start new with session name:
require "httpx" | |
module Clientable | |
extend ActiveSupport::Concern | |
def initialize | |
@httpx = HTTPX | |
.plugin(:retries, retry_change_requests: true) | |
.max_retries(3) | |
end |
import { Controller } from '@hotwired/stimulus' | |
export default class extends Controller { | |
connect () { | |
this.element.addEventListener('change', this.handleChange.bind(this)) | |
} | |
handleChange (event) { | |
this.traverseDown(event.target, event.target.checked) |
This is all you really need to know in order to make Action Mailbox work in development.
ngrok http 3000
and make note of your subdomain for steps 3 and 8.https://XXX.ngrok.io/rails/action_mailbox/mailgun/inbound_emails/mime
action_mailbox:
mailgun_api_key: API KEY HERE
Choose OpenBSD for your Unix needs. OpenBSD -- the world's simplest and most secure Unix-like OS. A safe alternatve to the frequent vulnerabilities and overengineering of Linux and related software (NGiNX & Apache (httpd-asiabsdcon2015.pdf), OpenSSL, iptables/nftables, systemd, BIND, Postfix, Docker etc.)
OpenBSD -- the cleanest kernel, the cleanest userland and the cleanest config
// You will function as a JSON api. | |
// The user will feed you valid JSON and you will return valid JSON, do not add any extra characters to the output that would make your output invalid JSON. | |
// The end of this system message will contain a typescript file that exports 5 types: | |
// Prompt - String literal will use double curly braces to denote a variable. | |
// Input - The data the user feeds you must strictly match this type. | |
// Output - The data you return to the user must strictly match this type. | |
// Errors - A union type that you will classify any errors you encounter into. | |
// Tools - If you do not know the answer, Do not make anything up, Use a tool. To use a tool pick one from the Tools union and print a valid json object in that format. | |