This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| from datetime import date | |
| from pathlib import Path | |
| FRONTMATTER_TEMPLATE = """--- | |
| layout: page | |
| title: {args.title} | |
| comments: true | |
| published: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| from subprocess import run | |
| from os.path import split | |
| from cleo import Command, Application | |
| import os | |
| ROOT = {'github': 'git@github.com', | |
| 'bitbucket': 'git@bitbucket.org'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/bash | |
| upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "state|to full| percentage" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| words.py: Reads from stdin and prints words one per line. | |
| """ | |
| import fileinput | |
| for line in fileinput.input(): | |
| for word in line.split(): | |
| print(word) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Rename to CONFIG.ini if using this file to add the path to fbexport | |
| [DEFAULT] | |
| # Update with the path to fbexport | |
| FBEXPORT = /path/to/fbexport |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env fish | |
| #Update your wallpaper image from Bing's daily image in KDE. | |
| #Requirements | |
| # Fish shell | |
| # kwallpaper.py available here: | |
| # https://gist.github.com/renegarcia/3890018ebab038f1f2e8adc8e3903231 | |
| # wpx (https://pypi.org/project/wpx/) | |
| set fname (wpx -d {$HOME}/Pictures/wallpapers --set-desktop --daily bing) | |
| kwallpaper.py $fname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from subprocess import call | |
| from argparse import ArgumentParser | |
| JS = """ | |
| /* | |
| * This script is meant to be run from the python interface below. | |
| */ | |
| const allDesktops = desktops(); | |
| for (desktop of allDesktops){{ | |
| desktop.wallpaperPlugin = "org.kde.image"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| # URL to title | |
| Simple program that reads an url and prints the last part of the path as a title. | |
| ## Case of use | |
| I use this to format references in my mardown documents. For example, given the url | |
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Desktop Entry] | |
| Comment=A personal knowledge management tool that grows as you do. | |
| Comment[es]=Una herramienta de administración de conocmiento personal que crece contigo. | |
| Exec=code --no-sandbox --new-window Dendron/dendron.code-workspace | |
| Name=Dendron | |
| Type=Application | |
| StartupWMClass=code | |
| Keywords=dendron;notes;pkm; | |
| Categories=Utility;TextEditor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from secrets import choice | |
| import string | |
| import argparse | |
| ALPHABET = string.ascii_letters + string.digits + string.punctuation | |
| def password_generator(len:int =10, alphabet: list[str] = ALPHABET) -> str: | |
| return "".join(choice(alphabet) for i in range(len)) | |