Skip to content

Instantly share code, notes, and snippets.

View pawamoy's full-sized avatar
🤔
Ping me if I don't reply!

Timothée Mazzucotelli pawamoy

🤔
Ping me if I don't reply!
View GitHub Profile
@kamilkrzyskow
kamilkrzyskow / performance_debug.py
Last active April 3, 2025 15:50
MkDocs hook for performance debugging
"""MkDocs hook for performance debugging
The idea behind it is to provide a minimal curated performance log for a `mkdocs build` run.
Of course anyone can use a proper profiler, but the output often contains a lot of non-critical data
that the user has to first filter to get a clearer picture. This hook takes care of this and allows
to quickly see where a bottleneck is occurring. It also has a lower overhead than a proper profiler.
It creates a file in the current working directory, it can be configured easily with variables set
at the bottom of the file. There are also the timing categories included.
@m-col
m-col / scroll_groups.py
Created May 6, 2020 19:14
scroll groups in qtile
"""
mod-m and mod-n scroll between groups right and left respectively.
Depending on the number of screens used the integers will need changing (where there are 3s, 4s and 5s below).
The numbers below are for 3 groups on one screen and 2 on the other - knowing that it can be worked out (hopefully!)
"""
def _scroll_screen(direction):
""" Scroll next group of subset allocated to specific screen """
if num_monitors > 1:
def _inner(qtile):
#!/bin/bash
# export DBUS_SESSION_BUS_ADDRESS environment variable because cron hates me
PID=$(pgrep -u USER gnome-session-b)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
/usr/bin/gsettings set org.gnome.shell.extensions.user-theme name 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.background picture-uri 'file://WALLPAPER-PATH'
/usr/bin/gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected] set org.zzrough.gs-extensions.drop-down-terminal background-color 'rgb(69,90,100)'
@ndarville
ndarville / django-pagination.html
Created September 2, 2012 15:45
Django Pagination Code
{% if page.has_other_pages %}
<div class="pagination">
<!-- Older page -->
{% if page.has_previous %}
<a href="?page={{ page.previous_page_number }}" title="Go to the older threads.">&lt;&nbsp;Older</a>
{% endif %}
<!-- First page -->
{% if current_page > 4 %}
<a href="?page=1">1</a>&nbsp;&#8943;