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
// Gist for https://medium.com/@ebakhtarov/bidirectional-websockets-with-redux-saga | |
import { eventChannel } from "redux-saga"; | |
import { all, call, put, take, select, race } from "redux-saga/effects"; | |
import { actionTypes } from "./constants"; | |
function watchMessages(socket) { | |
return eventChannel(emit => { | |
/* eslint-disable no-param-reassign */ |
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
import React from 'react'; | |
import { connect } from 'react-redux'; | |
class PageWidget extends React.Component { | |
componentDidMount() { | |
this.ifr.onload = () => { | |
this.ifr.contentWindow.postMessage('hello', '*'); | |
}; | |
window.addEventListener("message", this.handleFrameTasks); | |
} |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Solution</title> | |
</head> | |
<body> | |
<article></article> | |
<section id="result"> | |
<ol></ol> |
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: public.delete_cunit(text, integer) | |
-- DROP FUNCTION public.delete_cunit(text, integer); | |
CREATE OR REPLACE FUNCTION public.delete_cunit( | |
IN cunit text, | |
IN modelid integer, | |
OUT x text, | |
OUT tt text, | |
OUT tt2 text) |
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
cameras[cam].liveffmpeg = child_process.spawn("ffmpeg", [ | |
"-rtsp_transport", "tcp", //"udp" | |
"-i", "rtsp://root:[email protected]:554/mpeg4/media.amp", //cameras[cam].rtsp, | |
"-vcodec", "libx264", | |
"-c:v", "libvpx", | |
"-s", "320x240", | |
"-r", "10", | |
"-f","ffm", | |
"-an", | |
"http://mediain.example.com:8090/v1/user742/secret" |
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
var net = require('net'); | |
var server = net.createServer(function(socket) { | |
console.log('CONNECTED: ' + socket.remoteAddress +':'+ socket.remotePort); | |
startPyScript() | |
//console.log(socket); | |
// incoming messages from clients. | |
socket.on('data', function (data) { | |
//console.log(data.toString('utf8')); |