This is a placeholder file so we can host images.
This file contains hidden or 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 | |
# External dependencies: https://github.com/treyhunner/names | |
import random, names | |
count_default = 10 # Default length of list | |
def random_n_digits(n): | |
s = '' | |
for i in range(n): | |
s += random.choice('0123456789') |
This file contains hidden or 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 | |
import argparse, sys, re, slugify | |
# Return a "slug" (HTTP safe) name - https://stackoverflow.com/questions/19335215/what-is-a-slug | |
def markdown_title_name(t): | |
return slugify.slugify(t) | |
class markup_doc: | |
def __init__(self, f): | |
self.text = f.readlines() # Store as separate lines, for ease of processing |
This file contains hidden or 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
package main | |
import ( | |
"constraints" | |
"fmt" | |
) | |
type Number interface { | |
constraints.Integer | constraints.Float | constraints.Complex | |
} |
This file contains hidden or 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 | |
import re, sys, csv, argparse | |
from datetime import datetime | |
myTimezone = '' # does rclone log in locale timezone? | |
def perror(str): | |
print(str, file=sys.stderr) | |
# Function operates "in place" by reference on dict d, i.e. has side-effects on d |
This file contains hidden or 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 | |
# example of grafana/loki api when you need push any log/message from your python script | |
import requests, time | |
import names # get some random data | |
nano_ts = int(time.time()*1e9) | |
name = names.get_full_name() | |
# push msg log into grafana-loki | |
url="http://localhost:3100/loki/api/v1/push" |
This file contains hidden or 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 copy import deepcopy | |
from collections import deque | |
# Expand a tree to the "leaves" | |
def leaves_of(item, dependencies): | |
# return the leaf nodes | |
def dfs2(item, level, visited): | |
result = [] | |
if item in dependencies: |
OlderNewer