Skip to content

Instantly share code, notes, and snippets.

View domadev812's full-sized avatar
๐Ÿ˜Š
Always be ready!

Full-Stack Web Developer domadev812

๐Ÿ˜Š
Always be ready!
View GitHub Profile
@domadev812
domadev812 / 1.html
Last active November 15, 2017 21:06 — forked from ToeJamson/1.html
Transportation Delay: Create Real-Time Visualization of Data Using NVD3 And PubNub
<script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js'></script>
<link href='https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.css' rel='stylesheet'>
@domadev812
domadev812 / 1.json
Last active November 15, 2017 21:06 — forked from ToeJamson/1.json
Data Streams over WebSockets and HTTP Long Polling Protocols
{
"time": "2:07:04pm",
"price": "510.83",
"delta": "69.02",
"perc": "13.51",
"vol": 2930
}
{
"time": "2:07:06pm",
@domadev812
domadev812 / 01.py
Last active November 15, 2017 21:06 — forked from GleasonK/01.py
[Blog] DIY Hue Lightbulb with Android Control
#!/usr/bin/python
import time
import RPi.GPIO as GPIO
from pubnub.pnconfiguration import PNConfiguration
from pubnub.pubnub import PubNub
@domadev812
domadev812 / rpi-rt-audio-bdcast
Last active November 15, 2017 21:06 — forked from shyampurk/rpi-rt-audio-bdcast
RPi Realtime Audio Broadcast
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().channel(pubnub_responsechannel).message(postive_response).async(publish_callback)
@domadev812
domadev812 / 1.html
Last active November 15, 2017 21:06 — forked from ToeJamson/1.html
Displaying Live Location Points & Tracks with JavaScript & MapBox and PubNub
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.4.17.0.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.4/mapbox.js'></script>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.4/mapbox.css' rel='stylesheet' />
public void cleanup(){
try {
JSONObject payload = new JSONObject();
JSONObject left = new JSONObject();
JSONObject right = new JSONObject();
left.put("left_yaw", 400);
left.put("left_pitch",400);
right.put("right_yaw", 400);
right.put("right_pitch",400);
payload.put("left_hand", left);
@domadev812
domadev812 / 1.js
Last active November 15, 2017 21:06 — forked from ToeJamson/1.js
Creating Real-Time WebGL Visualizations
function handleMsg(msg) {
if (VISIBLE) {
addData(msg.pub, msg.subs);
}
}
pubnub = new PubNub({
publishKey : 'demo',
subscribeKey : 'demo'
})
public JSONObject handleHand(Hand hand){
boolean isLeft = hand.isLeft();
String handName = (isLeft) ? "left" : "right";
Vector direction = hand.direction();
int yaw = (int) Math.toDegrees(direction.yaw());
int pitch = (int) Math.toDegrees(direction.pitch());
// Normalize Yaw and Pitch
@domadev812
domadev812 / 1.h
Last active November 15, 2017 21:06 — forked from ToeJamson/1.h
Arduino To PubNub In Two Steps
#include <SPI.h>
#include <Ethernet.h>
#include <Pubnub.h>
#include "string.h"
#include "iotconnector.h"
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char pubkey[] = "PUBLISH KEYS HERE";char subkey[] = "SUBSCRIBE KEYS HERE";char channel[] = "iotchannel";char uuid[] = "Arduino";
@domadev812
domadev812 / Main.java
Last active November 15, 2017 21:06 — forked from ToeJamson/Main.java
Leap Motion - R Pi Remote Control Hands Edits
public class LeapToServo implements Runnable{
//Define Channel name
public static final String CHANNEL = "my_channel";
//Create PubNub instance
private Pubnub pubnub;
//Create Leap Controller instance
private Controller controller;
//is Runnable running?
private boolean running;