Skip to content

Instantly share code, notes, and snippets.

View rtviii's full-sized avatar

Artem Kushner rtviii

View GitHub Profile
@rtviii
rtviii / dirtocontext.py
Created November 8, 2025 13:55
Tired of curating the context by by grabbing individual files, just select to add to prompt
import os
import sys
import socket
import argparse
from pathlib import Path
from nicegui import ui
from fastapi import FastAPI
import uvicorn
PROJECT_DIR = None
@rtviii
rtviii / prompt_fullpath_toggle.sh
Last active May 3, 2024 04:44
This little shell function toggles your command line prompt to display full path or only the last 2 folders.
PROMPT_COMMAND=prompt_fullpath_toggle
export FULL_PATH_PROMPT="0"
function prompt_fullpath_toggle() {
if [ "$FULL_PATH_PROMPT" = "0" ]; then
export PS1="%F{blue}ᢹ%f %n [ %F{green}%10d%f ]${vcs_info_msg_1_} "
export FULL_PATH_PROMPT="1"
zle reset-prompt
@rtviii
rtviii / masif.py
Created April 19, 2024 04:32 — forked from edraizen/masif.py
MaSIF pymol plugin, merged to avoid finding correct paths
# Pablo Gainza Cirauqui 2016 LPDI IBI STI EPFL
# This pymol plugin for Masif just enables the load ply functions.
import os, sys
import math, re
from pymol import cmd, stored
import sys
from pymol import cmd, stored
#!/usr/bin/env python3
import os
import exiftool
import argparse
parser = argparse.ArgumentParser(description='Title argparse')
parser.add_argument('-info','--i', action='store_true',default=False, help='Print `exiftool` info.')
parser.add_argument('-r','--r', action='store_true',default=False, help='Proceed to rename rename', )
parser.add_argument('filename',type=str, help='path to document', )
args = parser.parse_args()
@rtviii
rtviii / unionenum.py
Last active December 4, 2025 23:07 — forked from plammens/unionenum.py
Enum union in Python
"""
Enum union based on and compatible with the standard library's `enum`.
"""
# MIT License
#
# Copyright (c) 2020 Paolo Lammens
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
To be able to `import pymol.cmd` in python scripts, it has to be on PYTHONPATH.
If you are building from source (and not buying from schroedinger), i guess it is the "modules" dir that should end up your path in particular. So, follow the vanilla installation (https://pymolwiki.org/index.php/Linux_Install) but the `setup` step ought to be replaced with the follwoing below, where
`path_to_pymol` is where pymol will be installed
```
python3 setup.py build install --home=path_to_pymol/
--install-lib=path_to_pymol/modules/ --install-scripts=path_to_pymol/
```
After that:
```