This file contains hidden or 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 APIController < ApplicationController | |
include JSONErrors | |
# ... | |
end |
This file contains hidden or 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
# Create a method 'search_methods' for the Object Class | |
class Object | |
def search_methods(qry) | |
self.methods & self.methods.select { |m| m.to_s.include? qry.to_s } | |
end | |
end | |
# Now search methods for any Ruby Object | |
Array.search_methods 'enum' # => [:to_enum, :enum_for] | |
Player.last.search_methods :trust # => [:untrust, :untrusted?, :trust] |
This file contains hidden or 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
import zmq | |
from pymouse import PyMouse | |
#mouse setup | |
m = PyMouse() | |
x_dim, y_dim = m.screen_size() | |
#network setup | |
context = zmq.Context() | |
socket = context.socket(zmq.SUB) |
NewerOlder