Skip to content

Instantly share code, notes, and snippets.

View phoerious's full-sized avatar

Janek Bevendorff phoerious

View GitHub Profile
@phoerious
phoerious / sphinx-doc-native-stub-conf.py
Last active June 10, 2026 15:52
Sphinx conf.py template for enabling stub file parsing for native submodules. Sphinx doc added support for stubs in 8.2.0, but if you have a non-native __init__.py at the top, it won't pick up the stub files. This conf.py template allows you to specify explicit stub file paths for native submodules.
import importlib
from importlib.abc import MetaPathFinder
from importlib.machinery import EXTENSION_SUFFIXES, ModuleSpec, SourceFileLoader
from pathlib import Path
import sys
# Requires sphinx>=9.0 !!!
# Path to your sources root here
src_dir = Path(...)
@phoerious
phoerious / dotfiles.md
Last active December 28, 2016 17:12
.zshrc, .vimrc, powerline config and other dotfiles
@phoerious
phoerious / star-rating.scss
Created August 2, 2012 12:39
Flexible Sass Star Rating
// Generate flexible star rating selectors by using an icon font
// Output selector for star ratings
@function star-rating-selector($start: 1, $end: 10) {
$return-val: "";
@for $i from $start through $end {
@if $i == $start {
$return-val: ".star.star#{$i}";
} @else {