This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Comment < ActiveRecord::Base | |
belongs_to :message | |
belongs_to :user | |
after_commit { CommentRelayJob.perform_later(self) } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CommentRelayJob < ApplicationJob | |
def perform(comment) | |
ActionCable.server.broadcast "messages:#{comment.message_id}:comments", | |
comment: CommentsController.render(partial: 'comments/comment', locals: { comment: comment }) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.comments = App.cable.subscriptions.create "CommentsChannel", | |
collection: -> $("[data-channel='comments']") | |
connected: -> | |
# FIXME: While we wait for cable subscriptions to always be finalized before sending messages | |
setTimeout => | |
@followCurrentMessage() | |
@installPageChangeCallback() | |
, 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://download.redis.io/redis-stable.tar.gz | |
tar xvzf redis-stable.tar.gz | |
cd redis-stable | |
make | |
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<handlers> | |
<add name="httpplatformhandler" path="*" verb="*" | |
modules="httpPlatformHandler" | |
resourceType="Unspecified" requireAccess="Script" /> | |
</handlers> | |
<httpPlatform stdoutLogEnabled="true" | |
startupTimeLimit="20" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# コントローラー | |
# /etc/neutron/plugins/ml2/ml2_conf.ini | |
[ml2] | |
# (ListOpt) List of network type driver entrypoints to be loaded from | |
# the neutron.ml2.type_drivers namespace. | |
# | |
# type_drivers = local,flat,vlan,gre,vxlan | |
type_drivers = vxlan | |
# Example: type_drivers = flat,vlan,gre,vxlan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def this_name | |
if any | |
'this is name' | |
end | |
'this is another name' | |
end |