Open ~/.zshrc in your favorite editor and add the following content to the bottom.
git_status() {
# Early return if not in a git repository| import json | |
| import re | |
| class CustomJSONEncoder(json.JSONEncoder): | |
| def encode_float(self, obj): | |
| if isinstance(obj, float): | |
| return format(obj, "f").rstrip('0').rstrip('.') | |
| return super().encode(obj) | |
| def encodeObj(self, obj): |
A clean and lightweight alternative to Redux using React's built-in Context + useReducer. Great for small to medium applications that need global state management without the overhead of additional libraries.
Example demonstrates a counter implementation but can be extended for more complex state management needs.
This guide shows a clean and type-safe approach to implementing global state management in React without external state management libraries. Perfect for small to medium-sized applications where Redux might be overkill.
| # Pi Agent Sandbox - Ubuntu-based development environment for pi agents | |
| FROM ubuntu:24.04 | |
| # Avoid interactive prompts during package installation | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # Set environment variables (running as root for easier development) | |
| ENV HOME=/root | |
| ENV PATH="${HOME}/go/bin:/usr/local/go/bin:${HOME}/.local/bin:${PATH}" | |
| ENV GOPATH="${HOME}/go" |