Skip to content

Instantly share code, notes, and snippets.

@abenstirling
abenstirling / pid.py
Created August 26, 2025 23:44
Simple PID Controller
# %%
import numpy as np
import matplotlib.pyplot as plt
# %%
dt = 0.01
T = 10.0
t = np.arange(0, T, dt)
# %%
@abenstirling
abenstirling / htd3.fs
Created May 24, 2024 01:52
HTD3 Featurescript
FeatureScript 1803;
import(path : "onshape/std/geometry.fs", version : "1803.0");
annotation { "Feature Type Name" : "Timing Belt Pulley" }
export const timingBeltPulley = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
annotation { "Name" : "Tooth Profile" }
definition.toothProfile is ToothProfile;
" Modeline and Notes {
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell:
"
" __ _ _____ _
" ___ _ __ / _/ |___ / __ __(_)_ __ ___
" / __| '_ \| |_| | |_ \ _____\ \ / /| | '_ ` _ \
" \__ \ |_) | _| |___) |_____|\ V / | | | | | | |
" |___/ .__/|_| |_|____/ \_/ |_|_| |_| |_|
" |_|
"
@abenstirling
abenstirling / notionsite.js
Created September 14, 2022 15:46
Notion Site
/* CONFIGURATION STARTS HERE */
/* Step 1: enter your domain name like fruitionsite.com */
const MY_DOMAIN = 'abenstirling.com';
/*
* Step 2: enter your URL slug to page ID mapping
* The key on the left is the slug (without the slash)
* The value on the right is the Notion page ID
*/
@abenstirling
abenstirling / setRpiWifi.py
Last active September 4, 2023 08:20
Set raspberry pi wifi with python
import os
#ssid aka wifi name
name = "testWifi"
#psk aka wifi pass
pwd = "password"
def CreateWifiConfig(SSID, password):