This has moved to https://github.com/tbnorth/defaultdotdict
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
basename -s .png *.png | xargs -P3 -IF bash -c "convert -density 400 F.pdf F.png; mogrify -trim -resize x740 F.png" | |
# probably something like | |
mogrify -format png -density 400 -trim -resize x740 F.pdf | |
# would do the same thing, but not the point of this gist |
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
""" | |
make_icons.py - make simple 4 color icons for the box00.png...box15.png | |
Could be adapted for other icon styles, iterates the 16 states in the | |
correct order. | |
WARNING: saves box00.png...box15.png in current directory | |
Terry Brown, [email protected], Tue Mar 27 12:01:11 2018 | |
""" |
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
theme_name = c.config.getString('theme-name') or c.config.getString('color-theme') | |
roots = [g.os_path_join(g.computeHomeDir(), '.leo'), g.computeLeoDir()] | |
theme_subs = ["themes/{theme}/Icons", "themes/{theme}", "Icons/{theme}"] | |
bare_subs = ["Icons", "."] # "." for icons referred to as Icons/blah/blah.png | |
paths = [] | |
for root in roots: | |
for sub in theme_subs: | |
paths.append(g.os_path_join(root, sub.format(theme=theme_name))) | |
for root in roots: |
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
from collections import namedtuple | |
Field = namedtuple("Field", 'name type') | |
# creates a `Field` class which has two fixed attributes, `name` and `type` | |
class TablesIndex: | |
"""TablesIndex - index of DB's and tables in an outline""" | |
def __init__(self, c): | |
"""initialize for c |
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
<html> | |
<head> | |
<style> | |
</style> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script src="https://d3js.org/d3-dispatch.v1.min.js"></script> | |
<script src="https://d3js.org/d3-selection.v1.min.js"></script> | |
<script src="https://d3js.org/d3-drag.v1.min.js"></script> | |
</head><body> | |
<svg width='900' height='600'> |
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
ls *.png | cat -n | sed 's/\(.*[0-9]\)\t\(.*\)/echo mv \2 $(printf %010d \1).png/' | bash |
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 | |
# capture stdin and show in separate window (virtual temporary paper) | |
# "git bash" version | |
cat >/tmp/$$.v.tmp | |
mintty --exec less /tmp/$$.v.tmp & |
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
""" | |
cross_factor.py - describe | |
Terry N. Brown, [email protected], Mon Apr 03 13:28:41 2017 | |
""" | |
from collections import namedtuple | |
def cross_factor(lists): | |
"""Return (as namedtuples) all combinations of elements from dict of lists""" |
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
""" | |
signal_manager.py - SignalManager - light weight signal management | |
Extremely light weight. No enforcement of signal arguments, or | |
even explicit listing of which signals exist. | |
Terry Brown, [email protected], Thu Mar 23 21:13:38 2017 | |
""" | |
from collections import defaultdict |