Skip to content

Instantly share code, notes, and snippets.

View paulrobello's full-sized avatar

Paul Robello paulrobello

View GitHub Profile
@paulrobello
paulrobello / __main__.py
Created November 18, 2024 20:13
Terminal plasma with Rich
import math
import time
import os
from rich.console import Console
from rich.live import Live
from rich.text import Text
console = Console()
console.clear()
@paulrobello
paulrobello / theme_dialog.py
Last active November 17, 2024 17:38
Textual theme picker dialog
"""Provides a modal dialog for selecting a theme."""
from __future__ import annotations
from textual import on
from textual.app import ComposeResult
from textual.binding import Binding
from textual.containers import Horizontal
from textual.containers import Vertical
from textual.screen import ModalScreen
@paulrobello
paulrobello / main.tf
Created September 27, 2024 18:29
LS Pro ACM Private CA Bug
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.69.0"
}
}
}
provider "aws" {
@paulrobello
paulrobello / game_of_life.py
Last active September 10, 2024 00:17
Game of life in terminal using Rich
"""
Conway's Game of Life implementation using Rich for terminal visualization.
Author: Paul Robello
Email: [email protected]
"""
import random
from enum import Enum
from time import sleep
@paulrobello
paulrobello / main.py
Last active August 15, 2024 18:12
textual tab change detect
"""MRE for Textual"""
from __future__ import annotations
import http
import requests
from textual import on, work
from textual.app import App, ComposeResult
from textual.message import Message
@paulrobello
paulrobello / Pipfile
Created August 1, 2024 23:10
MRE to test Textual v0.75.0 slowdown
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
attrs = "*"
certifi = "*"
requests-file = "*"
#textual = { version = "==0.74.0", extras = ["syntax"] }
@paulrobello
paulrobello / theme_manager.py
Created June 14, 2024 01:05
Textual Theme Manger
"""Theme manager for Textual"""
import os
from typing import Dict, List, Literal, Optional, TypeAlias
import simplejson as json
from textual.design import ColorSystem
ThemeMode: TypeAlias = Literal["dark", "light"]
ThemeModes: List[ThemeMode] = ["dark", "light"]
@paulrobello
paulrobello / list-bug.py
Last active March 6, 2024 16:55
Textual Hidden ListItem Bug
#!/usr/bin/env python
from textual.app import App, ComposeResult
from textual.widgets import Header, Footer, Log, Label, ListView, ListItem
from textual.containers import Horizontal
class ListApp(App[None]):
def compose(self) -> ComposeResult:
yield Header(show_clock=True)
with Footer():
@paulrobello
paulrobello / WsConnection.cs
Created January 29, 2024 22:02
Websocket connection manager with message subscription handling
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using UnityEngine;
using NativeWebSocket;
using PAR;
using Sirenix.OdinInspector;
using Sirenix.Utilities;
@paulrobello
paulrobello / WsMessageFilters.cs
Created January 29, 2024 21:59
Websocket message subscription filter
using System;
using System.Collections.Generic;
using System.Linq;
namespace Websocket
{
public interface IWsMessageFilterPredicate
{
bool Evaluate(IWsMessage msg);
}