Skip to content

Instantly share code, notes, and snippets.

View gmyrianthous's full-sized avatar

Giorgos Myrianthous gmyrianthous

View GitHub Profile
@gmyrianthous
gmyrianthous / text_classification.py
Last active November 12, 2017 13:17
Classification of movie reviews
# Text Classification with Perceptron
# Dataset: Review polarity - Cornell University
# Author: Giorgos Myrianthous
# February, 2017
import sys, os, random
import numpy as np
# np.set_printoptions(threshold=np.inf)
from collections import Counter
@gmyrianthous
gmyrianthous / bobp-python.md
Created February 1, 2019 08:50 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@gmyrianthous
gmyrianthous / kafka-console-consumer-top-n-messages
Last active March 5, 2021 21:05
kafka-console-consumer-top-n-messages
bin/kafka-console-consumer.sh \
--bootstrap-server localhost:9092 \
--topic testTopic \
--from-beginning \
--max-messages 10
@gmyrianthous
gmyrianthous / install-kafkacat
Created March 5, 2021 22:25
install-kafkacat
# Debian
$ apt-get install kafkacat
# OSX - homebrew
$ brew install kafkacat
@gmyrianthous
gmyrianthous / kafka-console-consumer-help
Last active March 5, 2021 22:26
kafka-console-consumer-help
$ kafka/bin/kafka-console-consumer.sh
Option Description
------ -----------
--blacklist <String: blacklist> Blacklist of topics to exclude from
consumption.
--bootstrap-server <String: server to REQUIRED (unless old consumer is
connect to> used): The server to connect to.
--consumer-property <String: A mechanism to pass user-defined
consumer_prop> properties in the form key=value to
@gmyrianthous
gmyrianthous / kafka-console-consumer-next-n-messages
Created March 5, 2021 21:13
kafka-console-consumer-next-n-messages
bin/kafka-console-consumer.sh \
--bootstrap-server localhost:9092 \
--topic test \
--max-messages 10
@gmyrianthous
gmyrianthous / kafka-console-consumer-all-messages.sh
Last active March 6, 2021 15:00
kafka-console-consumer-all-messages
bin/kafka-console-consumer.sh \
--bootstrap-server localhost:9092 \
--topic test \
--from-beginning
@gmyrianthous
gmyrianthous / kafkacat-consume-all-messages
Last active March 6, 2021 16:18
kafkacat-consume-all-messages
kafkacat \
-C \
-b localhost:9092 \
-t testTopic \
-o beginning
@gmyrianthous
gmyrianthous / kafkacat-consume-first-n
Created March 6, 2021 16:20
kafkacat-consume-first-n
kafkacat \
-C \
-b localhost:9092 \
-t testTopic \
-o beginning \
-c 10
@gmyrianthous
gmyrianthous / kafkacat-consume-last-n
Created March 6, 2021 16:49
kafkacat-consume-last-n
kafkacat \
-C \
-b localhost:9092 \
-t testTopic \
-c 10