Skip to content

Instantly share code, notes, and snippets.

View Verina-Armanyous's full-sized avatar

Verina Armanyous Verina-Armanyous

  • San Francisco, CA
View GitHub Profile
// this function createes a firebase menu
function onOpen() {
SpreadsheetApp.getUi().createMenu('🔥 Firebase Menu').addItem('Export to firestore', 'main').addToUi();
}
function main(){
// get the name of the current spreadsheet
var sheet = SpreadsheetApp.getActiveSheet();
var sheetName = sheet.getName();
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from kafka import KafkaConsumer
consumer = KafkaConsumer(
'tutorial',bootstrap_servers=['localhost:9092'],
value_deserializer=lambda x: loads(x.decode('utf-8')))
for message in consumer:
print(message)
from json import dumps
from kafka import KafkaProducer
# covert data to json and encode it to utf-8
producer = KafkaProducer(bootstrap_servers=['localhost:9092'],value_serializer=lambda x:dumps(x).encode('utf-8'))
for e in range(5):
data = {'number': e}
producer.send('tutorial', value=data)
# This code is from https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html
version: '2.2'
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.15.2
container_name: es01
environment:
- node.name=es01
- cluster.name=es-docker-cluster
- discovery.seed_hosts=es02,es03
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.