Skip to content

Instantly share code, notes, and snippets.

vipmax /
Created October 13, 2023 11:38
websocket send with response

websocket send with response

By default with WebSocket you only can send message.

0. Initialization

let ws = new WebSocket('ws://localhost:3000/ws')

ws.onopen = function(event) {
  console.log("on open")
vipmax / .tmux.conf
Last active December 30, 2023 12:25
alacritty and tmux confings
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
bind-key s set-option status
bind r source-file ~/.tmux.conf
bind h split-window -v
bind v split-window -h
vipmax / scala 3 and apache
Created November 10, 2022 10:38
scala 3 and apache spark

scala 3 and apache spark

1. Install The Scala installer is a tool named Coursier

mac os

brew install coursier/formulas/coursier && cs setup


vipmax / kafka concurrent batch commit
Last active September 20, 2018 15:55
kafka concurrent batch commit
val kafkaProps = new Properties()
kafkaProps.put("bootstrap.servers", endpoint)
kafkaProps.put("key.serializer", classOf[ByteArraySerializer])
kafkaProps.put("key.deserializer", classOf[ByteArrayDeserializer])
kafkaProps.put("value.serializer", classOf[ByteArraySerializer])
kafkaProps.put("value.deserializer", classOf[ByteArrayDeserializer])
kafkaProps.put("", "CrawlerTasksStorage")
kafkaProps.put("max.poll.records", "1000")

Kafka installation with systemd

0. Create kafka user

sudo adduser kafka
sudo adduser kafka sudo
su -l kafka

1. Download and Install kafka archive

cat social/scripts/social-site.service
cat social/scripts/social-crawler.service
import sys
reload(sys) # Reload does the trick!
import tarfile
# extract dictionary package
tar ="polyglot_data/sentiment2/ru/ru.sent.pkl.tar.bz2")