Skip to content

Instantly share code, notes, and snippets.

View tocttou's full-sized avatar
🌴

Ashish Chaudhary tocttou

🌴
View GitHub Profile
import cvfy
app = cvfy.register("nongh:0.0.0.0:5237349:5001:8003:localhost")
@cvfy.crossdomain
@app.listen()
def getsizes():
cvfy.sendGraphArray([
[
import cvfy
app = cvfy.register("nongh:0.0.0.0:5237349:5001:8003:localhost")
@cvfy.crossdomain
@app.listen()
def getsizes():
cvfy.sendGraphArray([
[
{ 'x': 'cat', 'y': 2 },
---
job: JobName
nodes:
- local
- 188.166.246.108
service1:
payload:
- payload/file1.json
- payload/file2.txt
exec:
{
"message": "This file is meant to be read by nodejs"
}
Here is some data to be read by python
with open('./file2.txt', 'r') as file:
f = file.read()
print f
const fs = require('fs');
fs.readFile('./file1.json', (err, data) => {
if (err) {
console.log('cannot read file1.json');
} else {
console.log(JSON.parse(data).message);
console.log(process.env.MY_MESSAGE);
}
});
import cvfy
import cv2
app = cvfy.register("nongh:0.0.0.0:6162884:5001:8001:localhost:5001")
@cvfy.crossdomain
@app.listen()
def cache_demo():
if cvfy.checkIfCachedResultsExist():
server {
listen 0.0.0.0:3001;
location / {
rewrite_by_lua_block {
local cookie_value = ngx.req.get_headers()["Cookie"]
if cookie_value ~= nil then
local jwt = cookie_value:match("access_token=([^ ]+)")
ngx.req.set_header("Authorization", "Bearer " .. jwt)
end
import React, { Component, PropTypes } from "react";
import io from "socket.io-client";
class App extends Component {
constructor(props, context) {
super(props, context);
this.state = {
message: null
};
this.socket = io("https://localhost:3001");