Skip to content

Instantly share code, notes, and snippets.

View mitya12342's full-sized avatar
🌺

Dimitriy Goloborodko mitya12342

🌺
View GitHub Profile
@alksily
alksily / README.md
Created November 10, 2019 11:50
How install push stream module for nginx on debian, ubuntu

Install NGINX with nginx-push-stream-module

Gist for Ubuntu and Debian users

Easy

nginx 1.16.1 + push stream module latest

apt-get update -y \
@iyvinjose
iyvinjose / data_loading_utils.py
Last active November 21, 2023 13:29
Read large files line by line without loading entire file to memory. Supports files of GB size
def read_lines_from_file_as_data_chunks(file_name, chunk_size, callback, return_whole_chunk=False):
"""
read file line by line regardless of its size
:param file_name: absolute path of file to read
:param chunk_size: size of data to be read at at time
:param callback: callback method, prototype ----> def callback(data, eof, file_name)
:return:
"""
def read_in_chunks(file_obj, chunk_size=5000):