brew install kafka
brew install zookeeper
zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties
kafka-server-start /usr/local/etc/kafka/server.properties
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
kafka-console-producer --broker-list localhost:9092 --topic test
kafka-console-consumer --bootstrap-server localhost:9092 --topic test --from-beginning
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 Jeremie :) | |
""" | |
from __future__ import print_function | |
import numpy | |
import tensorflow as tf | |
rng = numpy.random | |
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 Jeremie :) | |
""" | |
from __future__ import print_function | |
import numpy | |
import tensorflow as tf | |
rng = numpy.random |
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
kind: PersistentVolume | |
apiVersion: v1 | |
metadata: | |
name: cloudant-pv | |
labels: | |
app: microprofile-app | |
spec: | |
capacity: | |
storage: 4Gi | |
accessModes: |
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 socket = require('socket.io'); | |
var express = require('express'); | |
var app = express(); | |
var path = require('path'); | |
app.use(express.static(path.join(__dirname, 'build'))); | |
app.get('/*', function(req, res) { | |
res.sendFile(path.join(__dirname, 'build', 'index.html')); | |
}); |
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 WebSocket = require('ws'); | |
const ws = new WebSocket('wss://ws.kraken.com'); | |
ws.on('open', function open() { | |
ws.send(JSON.stringify({ | |
"event": "subscribe", | |
"pair": [ | |
"BTC/USD", | |
"ETH/USD", |
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
// @flow | |
import React from 'react' | |
import { View, StyleSheet } from 'react-native' | |
type Props = { | |
behind: React.Component, | |
front: React.Component, | |
under: React.Component | |
} |
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 axios from 'axios' | |
import store from './redux/store' | |
const AxiosInstance = axios.create() | |
AxiosInstance.interceptors.response.use( | |
(response) => { | |
return response | |
}, | |
async function (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
const transformFirestoreTypes = (obj: any): any => { | |
Object.keys(obj).forEach(key => { | |
if (!obj[key]) return | |
if (typeof obj[key] === 'object' && 'toDate' in obj[key]) { | |
obj[key] = obj[key].toDate().getTime() | |
} else if (obj[key].constructor.name === 'GeoPoint') { | |
const { latitude, longitude } = obj[key] | |
obj[key] = { latitude, longitude } | |
} else if (obj[key].constructor.name === 'DocumentReference') { | |
const { id, path } = obj[key] |
OlderNewer