Skip to content

Instantly share code, notes, and snippets.

Andrew Cholakian andrewvc

Block or report user

Report or block andrewvc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:887255
class MyApp < DripDrop::Node
def action
route :my_server, :websocket_server, 'ws://127.0.0.1:9292'
my_server.on_open do |response|
EM::PeriodicTimer.new(1) do
my_client.send_message(:name => 'time_request') do |response_message|
puts "The time is: #{response_message.body['time']}"
end
end
View authentication.rb
# include this in application controller
module Authentication
protected
# Inclusion hook to make #current_user and #signed_in?
# available as ActionView helper methods.
def self.included(base)
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method
end
# Returns true or false if the user is signed in.
You can’t perform that action at this time.