Skip to content

Instantly share code, notes, and snippets.


Cefn Hoile cefn

View GitHub Profile
#! /home/linuxbrew/.linuxbrew/opt/python@3.8/bin/python3.8
import os
import math
import shutil
import requests
from xml.etree import ElementTree
def decimalMinuteString(decimalDegreeString, paddegrees):
degrees = float(decimalDegreeString)
cefn / configurator.js
Last active Apr 5, 2020
Uploads design docs to couchdb through nano for Component testing within views
View configurator.js
const {
} = require("./designdocs/loader")
class CouchdbConfigurator{
if( //duck-type check for nano db handle
typeof dbHandle === "object" &&
typeof dbHandle.config === "object" &&
dbHandle.config.url &&
cefn / priority.js
Created Apr 5, 2020
Example view map function
View priority.js
var priorities = [
function getPriorityOrder(task) {
cefn / priority.test.js
Created Apr 5, 2020
Example unit-testing for CouchDB map function
View priority.test.js
const testScriptType = "map"
const testScriptId = "priority"
const priorities = [
cefn / loader.js
Last active Apr 5, 2020
Strategy for evaluating + unit-testing Couchdb map, reduce, update functions
View loader.js
const path = require("path")
const glob = require("glob")
const fs = require("fs")
const nodeEval = require("node-eval")
/** Helper object to construct a map of named design docs from a path containing js scripts.
* It populates couchdb design documents from js files targeting Spidermonkey 1.8.5
* File paths like
* * designdocs/map/priority.js
cefn /
Created Dec 15, 2019
Purchase order calculation comparing storage box vendors
from dataclasses import dataclass
class Vendor:
import pytest
def checkHelper(value):
assert list(value) == list('foo')
@pytest.mark.parametrize("value", (
def testInline(value):
def mapInitArgs(cls, fromType, toType, translateFun):
oldinit = cls.__init__
def newinit(self, *args, **kwargs):
fields = cls.__dataclass_fields__
fieldIter = iter(fields)
for pos,arg in enumerate(args):
fieldName = next(fieldIter)
if fields[fieldName].type is toType and type(arg) is fromType:
args[pos] = translateFun(arg)
View interactive-debugging-flowchart.graphml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns="" xmlns:java="" xmlns:sys="" xmlns:x="" xmlns:xsi="" xmlns:y="" xmlns:yed="" xsi:schemaLocation="">
<!--Created by yEd 3.18.1-->
<key"Description" attr.type="string" for="graph" id="d0"/>
<key for="port" id="d1" yfiles.type="portgraphics"/>
<key for="port" id="d2" yfiles.type="portgeometry"/>
<key for="port" id="d3" yfiles.type="portuserdata"/>
<key"url" attr.type="string" for="node" id="d4"/>
<key"description" attr.type="string" for="node" id="d5"/>
<key for="node" id="d6" yfiles.type="nodegraphics"/>
virtualenv myenv
pip3 install vgkits-vanguard
vanguard see firmware
vanguard brainwash circuitpython
vanguard shell
Launching Miniterm to connect to Vanguard Python Shell
Running ' --raw --eol CR --encoding ascii /dev/ttyUSB0 115200'
--- Miniterm on /dev/ttyUSB0 115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---