Skip to content

Instantly share code, notes, and snippets.

View churnikov's full-sized avatar
🤔
I'm Nikita by the way

Nikita Churikov churnikov

🤔
I'm Nikita by the way
View GitHub Profile
# Select base image (can be ubuntu, python, shiny etc)
FROM python:3.11-slim
# Create user name and home directory variables.
# The variables are later used as $USER and $HOME.
ENV USER=username
ENV HOME=/home/$USER
# Add user to system
RUN useradd -m -u 1000 $USER
FROM python:3.9-slim
ENV USER=nikita
ENV HOME=/home/$USER
# Add user to system
RUN useradd -m -u 1000 $USER
WORKDIR $HOME/app
@churnikov
churnikov / Dockerfile
Created October 30, 2024 16:03
Streamlit app for serve
FROM python:3.9-slim
ENV USER=username
ENV HOME=/home/$USER
# Add user to system
RUN useradd -m -u 1000 $USER
WORKDIR $HOME/app
@churnikov
churnikov / Dockerfile
Created October 29, 2024 18:02
Test files for the gradio app
# Select base image (can be ubuntu, python, shiny etc)
FROM python:3.11-slim
# Create user name and home directory variables.
# The variables are later used as $USER and $HOME.
ENV USER=username
ENV HOME=/home/$USER
# Add user to system
RUN useradd -m -u 1000 $USER
@churnikov
churnikov / README.md
Created August 15, 2023 18:03
stlite ketcher non-working example

I created a file using stlite and streamlit-ketcher

Unfortunately, it is not working, and I don't have time right now to figure out why. Just going to leave it here for now

@churnikov
churnikov / README.md
Last active March 7, 2024 12:01
Ketcher and PyScript: draw molecules and use them in python

How to use molecule drawing software Ketcher and PyScript together

This small example shows how to use Ketcher and PyScript.

The process is the following: Ketcher is a JavaScript app, that has js API. PyScript allows us call this api inside of browser.

In order to setup Ketcher and PyScript on your local machine do the following:

  1. Create a new folder. E.g. pyketch;
  2. cd into it;
@churnikov
churnikov / .flake8
Created April 11, 2022 10:18
How to setup pre-commit hooks
[flake8]
max-line-length = 120
inline-quotes = "
multiline-quotes = "
ignore = E203,W503
@churnikov
churnikov / Playbook
Created April 1, 2022 07:36
Playbook
У тебя спина белая))
@churnikov
churnikov / get_client_counts.py
Last active May 26, 2021 13:09
Как получить график количества запросов с разных клиентов из логов Loki
import json
import pandas as pd
from collections import Counter
def get_logs(paths):
logs = []
for path in paths:
df = pd.read_csv(path)
for line in df.iterrows():
logs.append(json.loads(line[1][1]))
return logs
@churnikov
churnikov / one_q_priority_pass.py
Created May 26, 2021 12:47
Как можно переопределить метод start_task
class OneQPriority(OneQ):
def __init__(self, config, priority=None):
self.priority = priority
super().__init__(config)
def start_task(self, **kwargs):
kwargs["priority"] = kwargs.get("priority", self.priority)
super().start_task(**kwargs)