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
// javascript | |
var takeSnapshot = function (clientId) { | |
var videoElem = document.getElementById(clientId); | |
var canvas = document.getElementById(“chat-paint-canvas”); | |
var ctx = canvas.getContext(‘2d’); | |
ctx.drawImage(videoElem, 0, 0, 30, 30); | |
return canvas.toDataURL(); | |
}; | |
// html |
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 'sinatra' | |
require 'open-uri' | |
require 'json' | |
# This application is the bare minimum to authorize with OAuth 2.0 | |
# using the authorization grant scheme. No error handling included. | |
# The application is both a client and a resource server. | |
# Start it by using 'ruby <file>' and navigate to http://localhost:4567 | |
# | |
# The application also needs the oauth-server written in Java. |
NewerOlder