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
<script type="text/javascript" src="swfobject.js"></script> | |
<script type="text/javascript"> | |
var swfVersionStr = "0"; | |
var xiSwfUrlStr = ""; | |
var flashvars = {}; | |
flashvars.url = "woo" | |
var params = {}; | |
params.quality = "high"; | |
params.bgcolor = "#ffffff"; |
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
<script type="text/javascript"> | |
function getBackground() { | |
return ‘<% @background %>’; | |
} | |
</script> |
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
var j:JSONDecoder = new JSONDecoder(ExternalInterface.call(‘getBackground’), false); |
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 Vehicle < ActiveRecord::Base | |
#has field :options, type hstore | |
end | |
class Truck < Vehicle |
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
require ::File.expand_path('../config/environment', __FILE__) | |
require 'faye' | |
require 'yaml' | |
faye_config = YAML.load_file(Rails.root.join('config','faye.yml'))[Rails.env] | |
Faye::Logging.log_level = :debug | |
faye = Faye::RackAdapter.new( | |
:host => faye_config['host'], | |
:mount => "/#{faye_config['mount']}" |
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
require ::File.expand_path('../config/environment', __FILE__) | |
require 'faye' | |
require 'faye/redis' | |
require 'yaml' | |
faye_config = YAML.load_file(Rails.root.join('config','faye.yml'))[Rails.env] | |
redis_config = YAML.load_file(Rails.root.join('config','redis_store.yml'))[Rails.env] | |
redis_uri = URI.split(redis_config) | |
Faye::Logging.log_level = :debug |
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
require ::File.expand_path('../config/environment', __FILE__) | |
require 'faye' | |
require 'faye/redis' | |
require 'yaml' | |
faye_config = YAML.load_file(Rails.root.join('config','faye.yml'))[Rails.env] | |
redis_config = YAML.load_file(Rails.root.join('config','redis_store.yml'))[Rails.env] | |
redis_uri = URI.split(redis_config) | |
Faye::Logging.log_level = :debug |
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
require 'base64' | |
module Publisher | |
class FayeAuth | |
def incoming(message, callback) | |
# Let non-subscribe messages through | |
unless message['channel'] == '/meta/subscribe' | |
return callback.call(message) | |
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
setupRealtime: function (config) { | |
if (window.Faye && Faye.Client && config.faye_uri) { | |
_.bindAll(this , 'onFayeConnect' , 'onFayeEvent'); | |
this.fayeClient = new Faye.Client(config.faye_uri , { | |
retry: 5 | |
}); | |
this.fayeClient.connect(this.onFayeConnect); | |
} | |
}, |
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
onFayeConnect: function (config) { | |
var user = this.get('user'); | |
this.fayeClient.addExtension({ | |
outgoing: function (message , callback) { | |
message.ext = {authToken: config.socket_auth_token , timestamp: config.socket_auth_timestamp}; | |
callback(message); | |
} | |
}); | |
his.fayeUserSubscription = this.fayeClient.subscribe('/' + user.get('id') + '/**' , this.onFayeEvent); | |
} |
OlderNewer