Skip to content

Instantly share code, notes, and snippets.

View btotr's full-sized avatar

Colin Meerveld btotr

View GitHub Profile
@btotr
btotr / scad
Created May 23, 2024 19:08
Hing in openCAD
$fn=30;
module hing_part(v){
difference(){
difference(){
union(){
difference(){
// knuckle
cylinder(20,1,1);
cylinder(10.1,1.1,1.1);
@btotr
btotr / central-device.py
Created April 15, 2024 11:39
Bluetooth cycling power profile client
from machine import Pin, I2C
from micropython import const
import asyncio
import aioble
import bluetooth
import binascii
import ssd1306
import matplotlib.pyplot as plt
from matplotlib.path import Path
import matplotlib.patches as patches
import pandas as pd
import sweat
x = [6, 180, 720]
X = sweat.array_1d_to_2d(x)
y = [831,436,332]
##
## Normalized power
##
import pandas as pd
import numpy as np
def cycling_np(s):
rolling = s.dropna().rolling(30).mean().dropna()
NP = round((((rolling**4).mean())**0.25),0)
return(NP)
@btotr
btotr / VAM
Created December 29, 2022 21:24
##
## Plotting velocità ascensionale media (VAM)
##
import pandas as pd
import plotly.express as px
import tempfile
import pathlib
import numpy as np
def window(slope, size=20):
std=[0]*round(len(slope)/(size))
p = 0
for i in range(0, len(slope)-size, size):
k=[0]*(size+1)
for t in (0, size):
k[t] = slope[i+t]
[Desktop Entry].
Version=1.0
Type=Application
Name=Monkey moves
Comment=Monkey moves web app
Exec=xdg-open https://monkeymovesamersfoort.trainin.app
Icon=/home/colin/.local/share/applications/monkey.png
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX edm: <http://www.europeana.eu/schemas/edm/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
@btotr
btotr / HeatMapByPropertyvalue.ajs
Created October 18, 2022 14:22 — forked from smileham/HeatMapByPropertyvalue.ajs
jArchi script to create Heatmap (set Red, Amber or Green background to element) based on the value of a given property. #jarchi
/*
* HeatMap by Property Value
*
* Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
*
* Version 1: Set colour to red, amber or green based on value of given property.
* Version 2: Pull out all Properties used in Elements in view, present all possible values of that Property to assign RAG colours
* Version 3: Error handling and key generation
* Version 4: Updated for dynamic colour selection and support for more than 3 colours
* Version 5: If there are less than 5 values, buttons are used instead of the menu.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase:<http://wikiba.se/ontology#>
SELECT ?dist ?monument ?shape ?shapeLabel ?image ?nummer
WHERE
{