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
<div class='overlay' id='auth-overlay'> | |
<div class="container" id="auth-super"> | |
<div class="row"> | |
<div class="col-sm-6" style="background: #afa6a6;border-radius: 10px;"> | |
<div id="auth-dialog"> | |
<div id="title-section"> | |
<div class="row"> | |
<div class="col-sm-8 col-sm-offset-3"><span><h4>PubNub WebRTC App with Parse</h4></span></div> |
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
public void successCallback(String channel, Object message) { | |
// TODO Auto-generated method stub | |
super.successCallback(channel, message); | |
Log.i("Subscribe","SUCCESS"+message.getClass()+" "+message.toString()); | |
try { | |
Globalvars.isSubscribed = true; | |
Log.i("Subscribe","SUCCESS sending message"+message.toString()); | |
Intent intent = new Intent(MY_ACTION); | |
intent.putExtra("message", message.toString()); |
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
$('#toggle').click(function(e){ | |
pubmsg = { "req" : "toggle" }; | |
pubnub.publish( | |
{ | |
channel : 'gpio-raspberry-control' , | |
message : pubmsg | |
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
// Define Backbone Stats model | |
app.Stat = Backbone.Model.extend({ | |
defaults: { | |
stats: [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]] | |
}, | |
localStorage: new Backbone.LocalStorage("pcm-stat") | |
}); | |
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
TaskPanel.prototype.addTask = function addTask(taskObj) { | |
var that = this; | |
var pos = this.taskSurfaces.length; | |
var tempTrans = new TransitionableTransform(); | |
var sizeTrans = new Transitionable([5, 5]); | |
var opacTrans = new Transitionable(0); |
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
def _callback(message,channel): | |
if message["type"]=="request" : | |
print" Received message = ", message["play"] | |
status=subprocess.call(["espeak","-s 120 -v en ",message["play"]], stdout=FNULL, stderr=subprocess.STDOUT) | |
if status==0 : | |
pubnub.publish(pubnub_responsechannel, postive_response) | |
elif status!=0 : | |
pubnub.publish(pubnub_responsechannel,negative_response) |
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
private static PreviewCallback previewCallback = new PreviewCallback() { | |
/** | |
* {@inheritDoc} | |
*/ | |
@Override | |
public void onPreviewFrame(byte[] data, Camera cam) { | |
if (data == null) throw new NullPointerException(); | |
Camera.Size size = cam.getParameters().getPreviewSize(); | |
if (size == null) throw new NullPointerException(); |
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
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection { | |
// if we're paused don't do anything | |
if(self.currentState==STATE_PAUSED) { | |
// reset our frame counter | |
self.validFrameCounter=0; | |
return; | |
} |
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
/***************************************************************************/ | |
/*PubNub C-Core Initialization*/ | |
pubnub_t *l_receive = pubnub_alloc(); | |
if (NULL == l_receive) | |
{ | |
printf("Failed to allocate Pubnub context!\n"); | |
return (void *)-1; | |
} |
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
function fetch (place, coordinates, i, aggregate) { | |
async.parallel([ | |
function(callback) { | |
request | |
.get('https://maps.googleapis.com/maps/api/timezone/json') | |
.query('location='+coordinates[1]+','+coordinates[0]) | |
.query({timestamp: Math.floor(new Date().getTime()/1000)}) | |
.query({key: gApiToken}) | |
.end(function(err, res){ | |
if(err) { console.log(err); callback(true); return; } |
OlderNewer