daijinara
Joined 11/27/2020
daijinara said about 2 years ago on Embedding Youtube Videos into Action Text with Stimulus :
If anyone is interested in using request.js instead of ujs, then
async attachContent(content) {
        let _this = this
        let formData = new FormData()
        formData.append("content", content)
        const response = await patch('/embed', { body: formData, responseKind: "json" })
        if (response.ok) {
            const data = response.json
            data.then((result) => {
                const attachment = new Trix.Attachment(result)
                _this.element.editor.insertAttachment(attachment)
                _this.element.editor.insertLineBreak()
            })
        }
    }

However, Rails 7 & turbo-rails ver. >=1.1.0 does not display ActionText attachments. It's really ugly but below is what I did while I am waiting for its upgrade. 
<% post.content.body.attachables.each do |node| %>
    <%= render partial: 'embeds/embed', locals: { embed: Embed.new(id: node.id) } %>
<% end %>

daijinara said over 1 year ago on MRSK in Depth :
  David Kimura  Thank you so much for this episode! This is so helpful and I am grateful to be part of your subscriber. Please allow me to ask you 1 question. If you want to build multiple clusters of web servers specific to different functions, how would you do? For example, Web Server Cluster A is for customer facing pages, and Web Server Cluster B is for Admin pages. I appreciate a lot for your insight in this, when you have time to reply.

daijinara said over 1 year ago on MRSK in Depth :
Thank you so much for your kind reply. My app has different database connections between the customer facing app and the Admin app, but both app are running on the same application and the domain, just differentiated by layout and authentication. Rails has been very helpful in keeping the engineering team small.

I really like your versatility of different structures, which I need to study more to accurately comprehend the each designs that you mentioned, and certainly Drifting with Ruby helps me to learn more! 

daijinara said over 1 year ago on Private Chat Groups :
Isn't it counter performative to index the role attribute, since it contains small number of possible values? 

The common data structure of index is a balanced-tree with leaf node as linked list, which only supports fast lookup when variety of the values is huge. Otherwise, all the redundant values will be stored in a linked list which is not quite different from scanning the whole table, and sometimes it would be even slower if it needs to fetch the rows one by one from the table.

If you can share me your thoughts why indexing is better, I will greatly appreciate it.

daijinara said 7 months ago on Developing in Docker :
How should I configure multi-database connections in the docker-compose file? I use postgres.yml from your past episode titled 'Multiple Databases'. 

I get this error below:

PG::ConnectionBad: connection to server at "::1", port 5432 failed: Connection refused (PG::ConnectionBad)