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
#!/usr/bin/env ruby | |
require 'celluloid' | |
require 'pp' | |
require 'timers' | |
#include Celluloid | |
class Bot | |
include Celluloid |
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
#!/usr/rubinius/2.0/bin/ruby | |
require 'rubygems' | |
require 'bundler/setup' | |
require 'reel' | |
require 'celluloid/autostart' | |
class TimeServer | |
include Celluloid | |
include Celluloid::Notifications |
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
require 'rubygems' | |
require 'bundler/setup' | |
require 'reel' | |
require 'celluloid/autostart' | |
require 'celluloid/redis' | |
require 'redis' | |
class TimeServer | |
include Celluloid | |
include Celluloid::Notifications |
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
#!/usr/bin/env ruby | |
require 'celluloid' | |
require 'celluloid/redis' | |
require 'sucker_punch' | |
class BWorker | |
include SuckerPunch::Job | |
include Celluloid::Redis |
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
require 'rubygems' | |
require 'bundler/setup' | |
require 'reel' | |
require 'celluloid/autostart' | |
require 'celluloid/redis' | |
class TimeServer | |
include Celluloid | |
include Celluloid::Notifications |
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
If I have an array of arrays in javascript like: | |
[ | |
[ 1, "a", "b"], | |
[ 2, "a", "b"], | |
[ 2, "c", "d"], | |
[ 3, "d", "d"] | |
] | |
How do I sort the array by the first column of each element? |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'base32' | |
require 'sinatra' | |
require 'mysql' | |
require 'json' | |
require 'ap' | |
require 'sys/proctable' | |
require 'turntabler' |
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
module Processtriggers | |
def validate_security(id, level) | |
returnset = 0 | |
case level | |
when 0 # Anyone | |
returnset = 1 | |
when 1 # Level 1 | |
returnset = 1 if(@botData['level1acl'].include?(id)||@botData['level2acl'].include?(id)||@botData['level3acl'].include?(id)||@botData['ownerid'] == id) | |
when 2 # Level 2 |
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
# Main | |
# Start Eventmachine main loop | |
bot = Neurobot.new | |
Turntabler.interactive | |
Turntabler.run do | |
# Start the client handle |
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
var server_list = [] | |
function createCORSRequest(method, url){ | |
var xhr = new XMLHttpRequest(); | |
if ("withCredentials" in xhr){ | |
xhr.open(method, url, true); | |
} else if (typeof XDomainRequest != "undefined"){ | |
xhr = new XDomainRequest(); | |
xhr.open(method, url); | |
} else { |
OlderNewer