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 | |
from functools import lru_cache | |
@lru_cache(maxsize=1024) | |
def combinations(beads, low_points): | |
if low_points == 1: | |
return 1 | |
return sum(combinations(n, (low_points - 1)) for n in range(0, (beads + 1))) |
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/bash | |
# Get all the annotated tag references | |
refs=$(git for-each-ref --format="%(if:equals=tag)%(objecttype)%(then)%(refname:short)%(end)" refs/tags) | |
# Review those to find the longest reference name | |
refs_as_list=(${refs}) | |
let longest_ref=0 | |
for i in "${refs_as_list[@]}" | |
do |
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 | |
""" | |
Utility script to help diff/log Perspective view.json files under git. | |
The git "textconv" feature is intended to convert binary files to a | |
rough text approximation, so that viewing diffs or logs of those files | |
will provide an idea of what changed. This script can be used as a | |
textconv on Ignition Perspective view.json files to extract JSON-encoded | |
script blocks into something that almost resembles proper Python |
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 | |
""" | |
Convert a JSON file to a YAML file | |
""" | |
import sys | |
import json | |
import ruamel.yaml as yaml |
OlderNewer