This file contains 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 | |
"""Flatpak CLI Shortcut Generator | |
A simple no-argument tool that generates launchers with traditional non-flatpak | |
command names for your installed Flatpak applications in ~/.local/bin/flatpak. | |
Does full collision detection and warns you if you forgot to add its output | |
directory to your PATH. Also overrules the command-line specified in the | |
``.desktop`` file if the Flatpak maintainer didn't include support for | |
command-line arguments. |
This file contains 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
-- Reasonably efficient pagination without OFFSET | |
-- SQLite version (Adapted from MS SQL syntax) | |
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6 | |
SELECT foo, bar, baz, quux FROM table | |
WHERE oid NOT IN ( SELECT oid FROM table | |
ORDER BY title ASC LIMIT 50 ) | |
ORDER BY title ASC LIMIT 10 |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
"""Example code for a PyQt image-display widget which Just Works™ | |
TODO: Split this into a loader wrapper and a widget wrapper so it can be used | |
in designs which maintain a preloaded queue of upcoming images to improve | |
the perception of quick load times. | |
""" | |
from __future__ import (absolute_import, division, print_function, |
This file contains 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
"""A QPlainTextEdit subclass with completion and some extras | |
Adapted from | |
https://doc.qt.io/qt-5/qtwidgets-tools-customcompleter-example.html | |
with the intent to be a minimally complicated way to get as-you-type | |
autocomplete in a QTextEdit. | |
As such, a lot of needless complexity has been removed, and odd design choices | |
which make the code needlessly difficult to maintain have been corrected. |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
"""Proof of concept code for generating and opening an OpenRaster image in the | |
user's preferred OpenRaster editor. | |
""" | |
__author__ = "Stephan Sokolow (deitarion/SSokolow)" | |
__appname__ = "OpenRaster Proof of Concept" | |
__version__ = "0.1" | |
__license__ = "MIT" |
This file contains 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 python2 | |
# -*- coding: utf-8 -*- | |
"""Simple notify2-based apt-get update notifier | |
Requires: | |
- dbus-python (A.K.A. python-dbus) | |
- notify2 | |
- python-gobject (for Python 2.x) | |
(Though it shouldn't be too difficult to adapt to Python 3.x since |
This file contains 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 python | |
"""python-xlib example which reacts to changing the active window/title. | |
Requires: | |
- Python | |
- python-xlib | |
Tested with Python 2.x because my Kubuntu 14.04 doesn't come with python-xlib | |
for Python 3.x. |
This file contains 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 python | |
"""Simple wrapper to update Transmission's IPv4 binding on startup for use with VPNs. | |
(For Linux systems. Tested on Ubuntu 14.04 LTS) | |
""" | |
import json, os, subprocess | |
VPN_IF = "tun0" | |
TRANSMISSION_CFG = os.path.expanduser('~/.config/transmission/settings.json') |
This file contains 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
#!/bin/sh | |
# Setup for comfortable use of an old two-button Logitech Marble Mouse | |
# via a cheap USB-PS/2 adapter. | |
# | |
# Resulting functionality: | |
# 1. Pointer acceleration is tweaked to be usable on a three-monitor spread | |
# 2. Press and hold left button for 300ms to get right-click | |
# 3. Right mouse button is remapped to middle mouse button | |
# 4. Holding the right button turns the trackball into a scroll wheel | |
# 5. Both vertical and horizontal scrolling are enabled |
NewerOlder