package main
import (
"encoding/json"
"fmt"
"rpc_engine"
)
func main() {
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
from flask import Flask, request | |
from flask_cors import CORS | |
import requests | |
app = Flask(__name__) | |
CORS(app) | |
@app.route('/<path:path>') | |
def root(path): |
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
package main | |
import ( | |
"encoding/json" | |
"io/ioutil" | |
"os" | |
"text/template" | |
) | |
func check(err error) { |
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
version: "3" | |
services: | |
kafka: | |
image: confluentinc/cp-kafka | |
depends_on: | |
- zookeeper | |
environment: | |
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | |
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 | |
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 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
package main | |
import ( | |
"encoding/json" | |
"html/template" | |
"io/ioutil" | |
"net/http" | |
"sort" | |
"time" | |
) |
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
const express = require('express') | |
const app = express() | |
const http = require('http') | |
const server = http.createServer(app) | |
const socket = require('socket.io') | |
const io = socket(server) | |
let config = { | |
servers: ['example.com', 'example.net'], | |
subtrahend: 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
package main | |
import ( | |
"bufio" | |
"flag" | |
"io/ioutil" | |
"log" | |
"net" | |
"os" | |
"strconv" |
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
package main | |
import ( | |
"bufio" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net" | |
"os" |
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
package main | |
import ( | |
"bufio" | |
"flag" | |
"io/ioutil" | |
"log" | |
"net" | |
) |
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 sessionize(nums, threshold) { | |
threshold = threshold || 3; | |
var i = 0, j = 0, sessions = []; | |
while (j < nums.length - 1) { | |
if (nums[j + 1] - nums[j] > threshold) { | |
sessions.push([nums[i], nums[j]]); | |
i = ++j; | |
} else { |
NewerOlder