Neovim, tmux, Starship, zoxide, fzf, exa, bash vi mode, ...
Shows git stats, command runtime etc. in a nice way.
You can change directory with partial keyword you remember. It will remember the most frequent cd and find it.
| vim.env.LAZY_STDPATH = ".repro" | |
| load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))() | |
| require("lazy.minit").repro({ | |
| spec = { | |
| { "folke/trouble.nvim", opts = {} }, | |
| -- add any other plugins here | |
| }, | |
| }) |
| # Run multiple commands in a tmux session | |
| script_dir=$(dirname "$(realpath -s "$0")") | |
| if [[ $# -ne 1 ]]; then | |
| sess=session_name | |
| else | |
| sess="$1" | |
| fi | |
| tmux new -d -s "$sess" -c "$script_dir" # Use default directory as this script directory |
| #include <sys/ioctl.h> | |
| #include <stdio.h> | |
| #include <unistd.h> | |
| #include <termios.h> | |
| enum { | |
| KEYSTATE_NONE = 1024, | |
| KEYSTATE_ESCAPE, | |
| KEYSTATE_CONTROL, | |
| KEYSTATE_MOUSE_PROPS |
| from rich.progress import ( | |
| Progress, | |
| ProgressColumn, | |
| SpinnerColumn, | |
| Task, | |
| TextColumn, | |
| TimeElapsedColumn, | |
| ) | |
| from rich.text import Text |
| import tensorrt as trt | |
| import torch | |
| import tqdm | |
| logger = trt.Logger(trt.Logger.WARNING) | |
| runtime = trt.Runtime(logger) | |
| with open("vae_encoder_engine.trt", "rb") as f: | |
| serialized_engine = f.read() |
| import ast | |
| import os | |
| from abc import ABC, abstractmethod | |
| from dataclasses import asdict, dataclass, fields | |
| from types import NoneType, UnionType | |
| from typing import get_args, get_origin | |
| import rich | |
| from rich.console import Console | |
| from typing_extensions import override |
| # NOTE: __future__ annotations are needed because we want to lazily evaluate torch type hints during runtime. | |
| # Or, you need to wrap the types in quotes, e.g. "torch.nn.Module" instead of torch.nn.Module. | |
| from __future__ import annotations | |
| from typing import TYPE_CHECKING | |
| if TYPE_CHECKING: | |
| import torch |
| #!/usr/bin/env python3 | |
| from pathlib import Path | |
| from safetensors.torch import load_file | |
| def summarize_tensor(x): | |
| if x is None: | |
| return "None" | |
| x = x.float() | |
| return f"({x.min().item():.3f}, {x.mean().item():.3f}, {x.max().item():.3f})" |
| """ | |
| This will make pptx slides containing images. | |
| It assumes your images are square shaped. | |
| """ | |
| from glob import glob | |
| from pptx import Presentation | |
| from pptx.dml.color import RGBColor | |
| from pptx.util import Inches |