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
/** | |
* @jsx React.DOM | |
*/ | |
var React = require('react'), | |
MyReactComponent = React.createClass({ | |
// The object returned by this method sets the initial value of this.state | |
getInitialState: function(){ | |
return {}; |
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
{ | |
"_id" : ObjectId("55a907962109d0860b71aff1"), | |
"appointment" : { | |
"appointment_time" : null, | |
"customer_requested_appointment_time" : null, | |
"label" : "", | |
"service_slot" : "" | |
}, | |
"asset" : { | |
"in_service_date" : null, |
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
let BitcoinPrices = []; | |
$(document).ready(function() { | |
let priceIntervalStream = Rx.Observable.interval(1000).flatMap( param => { | |
$('#cdDiv').html(param); | |
return getPriceStream(); | |
}); | |
priceIntervalStream.subscribe( x => { | |
$('#lbl-price').html(x.data.total.amount); | |
BitcoinPrices.push(x.data.total.amount); |
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 BitcoinPrices = []; | |
$(document).ready(function() { | |
var priceIntervalStream = Rx.Observable.interval(1000).flatMap(function (param){ | |
$('#cdDiv').html(param); | |
return getPriceStream(); | |
}); | |
priceIntervalStream.subscribe(function(x){ | |
$('#lbl-price').html(x.data.total.amount); | |
BitcoinPrices.push(x.data.total.amount); |
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 BitcoinPrices = []; | |
function countdown() { | |
var count = 10; | |
setInterval(function() { | |
count--; | |
//display the countdown timer to UI | |
$('#cdDiv').html(count); |
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 src="~/lib/swagger-client.js" type='text/javascript'></script> | |
<script type="text/javascript"> | |
$(document).ready(function () { | |
// initialize swagger, point to a resource listing | |
window.swagger = new SwaggerClient({ | |
url: "http://api.wordnik.com/v4/resources.json", | |
success: function () { | |
swagger.apis.account.getLoggedInUser({username: 'myusername', password: 'mypass'}, function(data){ |
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
//To make this work include the RTCMulticonnection.js file | |
//create a connection object to handle the sending procress of a file. | |
var connection = new RTCMultiConnection(); | |
document.getElementById('files').onchange = function() { | |
var file = this.files[0]; | |
connection.send(file); | |
}; |
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
//To send messages | |
var txtMsg = document.querySelector("#txtMsg") | |
$("#txtMsg").keydown(function(event){ | |
if(event.keyCode == 13){ | |
session.signal({ | |
type: "chat", | |
data: txtMsg.value | |
}, function(error){ | |
if(error){ |
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
#rooms_controller.rb | |
def show | |
@room = Room.find(params[:id]) | |
@opentTok_token = @opentok.generate_token @room.session_id | |
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
var apiKey = '45173502'; | |
var sessionId = "#{@room.session_id}" | |
var token = '#{@opentTok_token}'; | |
// Create a session object | |
var session = OT.initSession(apiKey, sessionId); | |
// connect to the session | |
session.connect(token, function(error) { | |
if (error) { |
NewerOlder