Skip to content

Instantly share code, notes, and snippets.

@rschroll
rschroll / setinput.sh
Created August 10, 2021 03:25
Wacom Tablet to Window Mapping
#!/bin/bash
# Map the tablet to cover a particular window, while maintaining its aspect
# ratio. If run from the terminal, it allows the user to click on the window
# for mapping. Otherwise, use the currently focused window. Should the
# window aspect ratio not match the tablet aspect ratio, the tablet will
# cover an additional area of the screen, to maintain the correct aspect
# ratio. By default, the window will be aligned with the top-left corner
# of the tablet, but options adjust the horizontal (-l, -c, -r) and vertical
# (-t, -m, -b) alignment.
@rschroll
rschroll / Outages.ipynb
Last active July 30, 2021 01:47
Monkeybrains Outages
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rschroll
rschroll / ProgrammingQuestionsA.ipynb
Created August 19, 2020 23:34
Programming Questions A
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rschroll
rschroll / Presentation.ipynb
Last active February 7, 2020 22:10
Pandas Pipeline
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rschroll
rschroll / Makefile
Created June 23, 2017 18:18
Makefiles and failing commands
.PHONY: good bad ugly good-bad bad-good good-dep bad-dep ugly-dep good-bad-dep bad-good-dep
good:
./good.sh
bad:
./bad.sh
ugly:
./ugly.sh
@rschroll
rschroll / flickable.qml
Last active December 22, 2015 15:19
A test case demonstrating problems with setting flickable = null in the Ubuntu SDK. (Now fixed!)
import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.ListItems 0.1
MainView {
width: units.gu(50)
height: units.gu(75)
Page {
id: page
@rschroll
rschroll / copyright.py
Created November 7, 2015 20:32
Check git history for additional copyright lines
@rschroll
rschroll / resympy.py
Created August 17, 2012 03:34
Sympy wrapper for Reinteract
# Copyright 2009, 2010, 2012 Jorn Baayen
# Copyright 2012 Robert Schroll
#
# Released under the BSD license.
#
# Based on code proposed for inclusion with Reinteract. This version uses
# matplotlib's TexManager to display the LaTeX instead of Lasem, but works
# similarly otherwise.
import gtk
@rschroll
rschroll / highlightedtext.py
Created June 16, 2012 23:05
Decoding #pdfloc for highlighted text in the Sony PRS-T1
#!/usr/bin/env python
"""
%s mount-point
Print to a file information on the highlighted text of a selected file on
the reader at mount-point. The output file is tab-separated data of the
form:
page highlight-range mark-start mark-end mark-type marked-text
mark-start and mark-end are the 'pdfloc' data defining where the marked
@rschroll
rschroll / gist:2221668
Created March 28, 2012 00:06
Delayed resize of sidebar widgets in Reinteract
import gobject as _gobject
class _ResizeBox(_gtk.VBox):
def __init__(self, figure):
_gtk.VBox.__init__(self)
self.figure = figure
# Rounding errors slowly accumlate in the figure height, shrinking it down
# over time. So we make a copy here and use that to keep resetting the
# canvas to the proper size.