Skip to content

Instantly share code, notes, and snippets.

View leovujanic's full-sized avatar

Leo Vujanić leovujanic

View GitHub Profile
@leovujanic
leovujanic / abstract-unique-validator.ts
Created May 18, 2021 10:40 — forked from zarv1k/abstract-unique-validator.ts
Unique Validator Example for NestJS
import { ValidationArguments, ValidatorConstraintInterface } from 'class-validator';
import { Connection, EntitySchema, FindConditions, ObjectType } from 'typeorm';
interface UniqueValidationArguments<E> extends ValidationArguments {
constraints: [
ObjectType<E> | EntitySchema<E> | string,
((validationArguments: ValidationArguments) => FindConditions<E>) | keyof E,
];
}
@leovujanic
leovujanic / README.md
Created February 19, 2018 12:58 — forked from kesuskim/README.md
Add ZooKeeper to systemd in CentOS 7 for HDFS

This is for self reference; change appropritely as your needs.

You should make /var/log/zookeeper directory, and give permission to zookeeper account.

# mkdir /var/log/zookeeper
# chown zookeeper:zookeeper -R /var/log/zookeeper
@leovujanic
leovujanic / benchmark-commands.txt
Created January 2, 2018 14:57 — forked from jkreps/benchmark-commands.txt
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
@leovujanic
leovujanic / 0_reuse_code.js
Created September 16, 2016 06:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console