Skip to content

Instantly share code, notes, and snippets.

View edpyt's full-sized avatar
🦍
todo!();

edpyt

🦍
todo!();
View GitHub Profile

Ghostty Keyboard Shortcuts

Default keyboard shortcuts for Ghostty terminal emulator. Platform-specific differences are noted where applicable.

Window Management

Action Windows/Linux macOS
New window Ctrl+Shift+N Cmd+N
Close window Alt+F4 Cmd+Shift+W
@EdenQwQ
EdenQwQ / animations.nix
Created January 6, 2025 11:42
My niri setup using nix
{
programs.niri.settings.animations = {
window-open = {
easing = {
curve = "ease-out-expo";
duration-ms = 800;
};
};
window-close = {
easing = {
@edpyt
edpyt / conftest.py
Last active January 25, 2025 15:10
SQLAlchemy, PyTest nested transaction mode
from typing import Generator
import pytest
from sqlalchemy import Engine, create_engine
from sqlalchemy.orm import Session, sessionmaker
from .models import Base
@pytest.fixture(name="engine", scope="session")
@bomzheg
bomzheg / Desc.md
Created February 28, 2024 19:29
dishka tests

We have some app and dishka container

from fastapi import FasAPI

from dishka.integrations.fastapi import Depends, inject, setup_dishka

router = APIRouter()

@router.get("/")
@inject
@aleixmorgadas
aleixmorgadas / 0_README.md
Last active April 7, 2025 12:36
Starting a FastAPI as a server mock

Using FastAPI as Server Mock

I wanted to start a real mock server with real instances that I could fine tune for my own needs.

I found a way to start the FastAPI to run the tests agains it, and then kill the uvicorn.

Here an example code 👍

image

@gelldur
gelldur / Grafana Alert Template.md
Last active April 22, 2025 10:14 — forked from Himura2la/Grafana Alert Template.md
How to use Grafana Alerts with the Telegram
  • Template name: telegram.message
  • Content:
    {{- /* Telegram message to use: {{ template "telegram.message2" . }} */ -}}
    {{ define "__alerts_list" -}}
    {{ range . }}
    {{if ne (index .Labels "alertname") "" -}}
    {{ if eq .Status "firing" }}🔴{{ else }}🟢{{ end }}
        {{- if ne (index .Labels "severity") "" -}}
            <u><b>P{{ index .Labels "severity" }}</b></u> {{ end -}}
@fabian-thomas
fabian-thomas / orgzly-sync.sh
Last active March 9, 2025 11:35
Orgzly auto syncronisation for sync tools like syncthing. See orgzly/orgzly-android#8.
#!/data/data/com.termux/files/usr/bin/bash
# https://github.com/orgzly/orgzly-android/issues/8
orgzly_sync() {
# if you are using orgzly-revived use the following instead:
# am broadcast -n com.orgzlyrevived/com.orgzly.android.ActionReceiver -a com.orgzly.intent.action.SYNC_START
am broadcast -n com.orgzly/com.orgzly.android.ActionReceiver -a com.orgzly.intent.action.SYNC_START
}
@amantinband
amantinband / Aggregates.Bill.md
Last active January 2, 2025 19:24
Buber Dinner Domain Aggregates

Domain Aggregates

Bill

class Bill
{
    // TODO: Add methods
}
@Himura2la
Himura2la / Grafana Alert Template.md
Last active December 24, 2024 14:41
How to use Grafana Alerts with the Telegram
  • Template name: telegram.message
  • Content:
    {{ define "alert_list" }}{{ range . }}{{ .Labels.alertname }}
    {{ range .Annotations.SortedPairs }}<strong>{{ .Name }}</strong>: {{ .Value }}
    {{ end }}| {{ if gt (len .GeneratorURL) 0 }}<a href="{{ .GeneratorURL }}">source</a> | {{ end }}{{ if gt (len .SilenceURL) 0 }}<a href="{{ .SilenceURL }}">silence</a> | {{ end }}{{ if gt (len .DashboardURL) 0 }}<a href="{{ .DashboardURL }}">dashboard</a> | {{ end }}{{ if gt (len .PanelURL) 0 }}<a href="{{ .PanelURL }}">panel</a> |{{ end }}
    —
    {{ end }}{{ end }}
    {{ define "telegram.message" }}
    

{{ if gt (len .Alerts.Firing) 0 }}FIRING!!!

@rafaelhenrique
rafaelhenrique / test_sqlalchemy+asyncpg.py
Created April 17, 2021 02:06
Sqlalchemy + Asyncpg + Pytest = <3
# reference: https://github.com/sqlalchemy/sqlalchemy/issues/5626
import pytest
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
Base = orm.declarative_base()