Skip to content

Instantly share code, notes, and snippets.

View HannesHil's full-sized avatar

Hannes Hilbert HannesHil

  • inovex GmbH
  • Karlsruhe
View GitHub Profile
@molomby
molomby / github-latex-superscript-subscript-demo.md
Last active January 7, 2025 17:18
Superscript and Subscript in LaTeX for GitHub

Superscript and Subscript in LaTeX for GitHub

Experimenting GitHubs new LaTeX support to render superscript and subscript.

You can create mathematical expressions including superscript, eg:

$$e^{-\frac{t}{RC}}$$

But you can also put plaintext into superscript, inline $^{like\ this\ and\ ^{then\ go\ smaller}\ ^{if\ you\ want}}$. Subscript works the same but with _ instead of ^ and looks $_{like\ this}$.

@jjmaestro
jjmaestro / whisper-calculator.py
Last active January 25, 2025 05:11
whisper-calculator.py: Calculates the size of the whisper storage for the given retention (in frequency:history format)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def archive_to_bytes(archive):
def to_seconds(s):
SECONDS_IN_A = {
's': 1,
'm': 1 * 60,
'h': 1 * 60 * 60,
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 24, 2025 09:49
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'