Skip to content

Instantly share code, notes, and snippets.

View aoberoi's full-sized avatar
👷‍♂️
Under construction

Ankur Oberoi aoberoi

👷‍♂️
Under construction
View GitHub Profile
@aoberoi
aoberoi / test.html
Created June 20, 2012 17:20
kip test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test</title>
<script src="http://staging.tokbox.com/v0.91/js/TB.min.js" ></script>
<script>
var open_tok_api_key = 1127;
var open_tok_session_id = '1sdemo00855f8290f8efa648d9347d718f7e06fd';
var open_tok_token = 'devtoken';
(virtual_env)Nora:havelock ankur$ easy_install lib/tbshared-0.7.0-py2.6.egg
Processing tbshared-0.7.0-py2.6.egg
Removing /Users/ankur/Developer/tokbox/nwidget/havelock/virtual_env/lib/python2.7/site-packages/tbshared-0.7.0-py2.6.egg
Copying tbshared-0.7.0-py2.6.egg to /Users/ankur/Developer/tokbox/nwidget/havelock/virtual_env/lib/python2.7/site-packages
tbshared 0.7.0 is already the active version in easy-install.pth
Installed /Users/ankur/Developer/tokbox/nwidget/havelock/virtual_env/lib/python2.7/site-packages/tbshared-0.7.0-py2.6.egg
Processing dependencies for tbshared==0.7.0
Searching for tbshared==0.7.0
Reading http://pypi.python.org/simple/tbshared/
@aoberoi
aoberoi / titanium-opentok-init.js
Created July 24, 2012 20:28
Typical initialization of Session using opentok titanium module
// Create a session
var opentok = require('com.tokbox.ti.opentok');
var session = opentok.createSession({ sessionId : CONFIG.sessionId });
// Hook into events
session.addEventListener("sessionConnected", sessionConnectedHandler);
session.addEventListener("sessionDisconnected", sessionDisconnectedHandler);
session.addEventListener("streamCreated", streamCreatedHandler);
// Connect
@aoberoi
aoberoi / parse.html
Created July 27, 2012 01:17
Parse email
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www=
=2Ew3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html style=3D"height: 100%;">
<head>
<!-- This is a simple example template that you can edit to create=
your own custom templates -->
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3D=
UTF-8">
<!-- Facebook sharing information tags -->
<meta property=3D"og:title" content=3D"Parse News: Anypic, App Gal=
$.ajax({
url:'https://staging.tokbox.com/hl/session/create',
type: 'POST',
crossDomain: true,
headers: {
'X-TB-PARTNER-AUTH': $("#api_key").val() + ":" + $("#api_secret").val()
},
data: {
'location': $('#location_hint').val(),
'p2p.preference': $("input:radio[name=p2p_enabled][checked]").val()
var getUserEndpoint = "http://www.tokbox.com:3000/accounts/me.json";
$.ajax({
type: 'GET',
url: getUserEndpoint,
dataType: 'json',
success: function(data) {
if (data.error) {
console.log(data.error);
} else {
console.log(data)
diff --git a/nwidget/build/assets/www/application/models/Build.class.php b/nwidget/build/assets/www/application/models/Build.class.php
index 8fd7780..3c47000 100644
--- a/nwidget/build/assets/www/application/models/Build.class.php
+++ b/nwidget/build/assets/www/application/models/Build.class.php
@@ -16,8 +16,6 @@ class Build {
const staging_server = '@tokbox.nwidget.staging_widget_url@';
const staging_server_ssl = '@tokbox.nwidget.ssl_staging_widget_url@';
-
- const dashboard_server = '@tokbox.nwidget.dashboard_url@';
Started POST "/users/sign_in" for 127.0.0.1 at 2012-09-04 17:03:42 -0400
Processing by Devise::SessionsController#create as HTML
Parameters: {"user"=>{"email"=>"[email protected]", "password"=>"[FILTERED]"}}
WARNING: Can't verify CSRF token authenticity
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."email" = '[email protected]' LIMIT 1
(0.1ms) begin transaction
(0.4ms) UPDATE "users" SET "last_sign_in_at" = '2012-09-04 21:01:14.102241', "current_sign_in_at" = '2012-09-04 21:03:42.191294', "sign_in_count" = 21, "updated_at" = '2012-09-04 21:03:42.192392' WHERE "users"."id" = 1
(0.7ms) commit transaction
Redirected to http://dashboard.tokbox.com:3000/
Completed 302 Found in 130ms (ActiveRecord: 0.0ms)
#<ActionDispatch::Request:0x007f9e2948f408 @env={"SERVER_SOFTWARE"=>"thin 1.4.1 codename Chromeo", "SERVER_NAME"=>"dashboard.tokbox.com", "rack.input"=>#<StringIO:0x007f9e293174b8>, "rack.version"=>[1, 0], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>false, "rack.multiprocess"=>false, "rack.run_once"=>false, "REQUEST_METHOD"=>"POST", "REQUEST_PATH"=>"/users/sign_in.json", "PATH_INFO"=>"/users/sign_in.json", "REQUEST_URI"=>"/users/sign_in.json", "HTTP_VERSION"=>"HTTP/1.1", "HTTP_HOST"=>"dashboard.tokbox.com:3000", "HTTP_CONNECTION"=>"keep-alive", "HTTP_CACHE_CONTROL"=>"no-cache", "HTTP_ORIGIN"=>"http://tokbox.com", "HTTP_PRAGMA"=>"no-cache", "HTTP_USER_AGENT"=>"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1", "HTTP_ACCEPT"=>"application/json, text/javascript, */*; q=0.01", "HTTP_REFERER"=>"http://tokbox.com/", "HTTP_ACCEPT_ENCODING"=>"gzip,deflate,sdch", "HTTP_ACCEPT_LANGUAGE"=>"en-US,en;q=0.8", "HTTP_ACCEPT_CHARSET"=>"ISO-8859-1,utf-
$.ajax({
url: 'http://dashboard.tokbox.com:3000/users/sign_in.json',
dataType: 'json',
method: 'POST',
xhrFields: { withCredentials: true },
crossDomain: true,
data: formData,
success:function(data, textStatus, jqXHR) {
console.log("data");
console.log(data);