The attached GraphViz dotfile is adapted from the Python documentation for collections.abc.
" | |
" Place in ~/.vim/after/syntax/xml.vim | |
" | |
" This enables Java syntax highlighting for the BeanShell embedded within CDATA | |
" regions of rule XML for Sailpoint IIQ. | |
" | |
" There might be better ways to limit loading this syntax than looking in the | |
" first 5 lines for 'language="beanshell"', but I cannot figure out how and this | |
" works for now. | |
" |
I am testing an object with varied datasets, which I am creating as separate fixtures, so my fixture names become rather long
due to encoding enough distinguishing characteristics so I can keep their purposes straight.
I have to refer to my object a number of times throughout the test and futhermore there is a local convention for the name
of the object in production code, so it makes sense to use the same short name in my tests.
As a result, one of the very first things I do in the test is alias the long fixture name to the short conventional name, as
can be seen in the assignment to foo
in test_01_before.py
.
Whenever I do this, I wish to myself "it's too bad there isn't a way to express the fixture declaration/import with an alias
from setuptools import setup, Command | |
class ListRequirements(Command): | |
"""In-line command to display declared requirements.""" | |
# TODO: | |
# * Add option to write out in a format | |
# comaptible with requirements.txt. | |
# * Add options to restrict to particular | |
# kinds & extras. | |
user_options = [] |
I'd like to be able to interactively apply the contents of a stash to the working copy, much as one can do with git checkout -p
, git add -p
and git stash save -p
.
The following is a bit of fiddling that I've done to figure out how to do this.
It might one day grow into an actual PR but right now it's all just manual.
- Get the hash of the stash commit:
$ git rev-parse stash@{0}
feeebb56d0299c7dd130d643b21a73c2482a37c1
# docs/Makefile.dash | |
include Makefile | |
PROJECT_NAME = $(shell python ../setup.py --name) | |
.PHONY: dashdoc | |
dashdoc: | |
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) -D 'html_theme=epub' $(BUILDDIR)/dashdoc | |
doc2dash -A -v -n $(PROJECT_NAME) -d $(BUILDDIR)/ -f -I index.html -j $(BUILDDIR)/dashdoc | |
@echo | |
@echo "Build finished. The Docset is in $(BUILDDIR)/$(PROJECT_NAME).docset." |
# Ensure this script is run with the correct user by checking | |
RUNAS_USER="svcuser" | |
# Can use "$USER" instead of "$(id -un)" if the environment | |
# variable can be trusted; saves the exec(2) of the `id` which | |
# could be important -- because exec's are a bit more expensive | |
# and `id` can incur the overhead of a slow nameservice lookup. | |
# These would be important in a script used to shutdown or otherwise | |
# recover a system that is in distress due to resource starvation, | |
# for example. |
# Starts like this... | |
class strictly_following_style_guide { | |
yumrepo { 'puppetlabs-products': | |
descr => 'Puppet Labs Products El $releasever - $basearch', | |
baseurl => 'http://yum.puppetlabs.com/el/$releasever/products/$basearch', | |
gpgkey => 'file:///etc/pki/rpm-gpg/PUPPETLABS_GPG_KEY', | |
gpgcheck => '1', | |
} | |
} |
# Install, configure, and make persistent, iptables. | |
class iptables ( | |
$publicports = [], | |
) | |
{ | |
include | |
'iptables::config', | |
'iptables::service', | |
'iptables::install' |
module/foo/manifests/init.pp: | |
class foo { | |
file { 'foo': | |
source => 'puppet:///modules/foo/usual-case.conf' | |
} | |
} | |
module/foo/manifests/special.pp: | |
class foo::special inherits foo { | |
File['foo'] { |