Skip to content

Instantly share code, notes, and snippets.

@formatc1702
formatc1702 / schraubenkiste.py
Created July 23, 2020 15:34
Schraubenkiste cheat sheet
# Generate a quick HTML page to view the characters generated by the Schraubenkiste.ttf font
# Font source: http://www.peter-wiegel.de/Schraubenkiste.html
screw_shapes = [
('ZY', 'E010'),
('FL', 'E012'),
('LK', 'E013'),
('HR', 'E014'),
('SE', 'E015'),
('RS', 'E016')
@formatc1702
formatc1702 / colorlist.py
Last active July 20, 2020 14:21
Auto-generate color documentation
import wv_colors
for k, v in wv_colors._color_hex.items():
print(f'- `{k}` ![#{v}](https://via.placeholder.com/15/{v.replace("#","")}/000000?text=+) ({wv_colors._color_full[k]})')
@formatc1702
formatc1702 / longconnectionsets.yml
Created July 11, 2020 09:39
Test long connection sets in WireViz
connectors:
X1: &proper
type: proper connector
pincount: 4
F1:
autogenerate: true
# category: ferrule
pincount: 1
color: PK
F2:
@formatc1702
formatc1702 / alternatingtest.py
Last active July 11, 2020 08:40
Check if items in list alternatingly match keys in two dicts
# fake YAML input data (only keys matter)
connectors = {'A': [1,2,3], 'B': [1,2,4], 'C': [3,6,7]}
cables = {'X': [4,4,4], 'Y': [4,5,6], 'Z': [9,9,9]}
# list to check, should alternatingly contain connector and cable keys, may start with either
listy = ['A','X','B','Y','C']
conkeys = list(connectors.keys())
cblkeys = list(cables.keys())
@formatc1702
formatc1702 / linebreaks.yml
Last active July 10, 2020 19:30
Line breaks in WireViz input fields
connectors:
X1:
pincount: 3
type: |
Very
long
connector
type
subtype: |
Even