Skip to content

Instantly share code, notes, and snippets.

View khoitsma's full-sized avatar

Karl Hoitsma khoitsma

View GitHub Profile
@khoitsma
khoitsma / overlay_test.py
Last active October 30, 2018 18:14
Pythonista Overlay Test
# credit: github.com/mikaelho/pythonista-gestures
# credit: github.com/jsbain/viewbrowser
from overlay import Overlay, AppWindows
from gestures import Gestures
import ui
if __name__=='__main__':
# credit: mikaelho / pythonista – gestures
# credit: tdamdouni / Pythonista
# credit: Pythonista / slider / SliderWithLabel_danrcook.py
class AugmentedSliderWithLabel(ui.View):
'''wrapper for ui.Slider to also show a label. You can edit the value of the slider directly in the label since it is a textfield. Can take the following keyword arguments:
- for the slider:
>> value: default value when presented (should be a number that is less than max_val and greater than 0). The default is 50
>> max_val: the default for a usual slider is 1.0. SliderWithLabel will conventiently multiply the max_val for the label display and for returning it's value attribute. The default is 100
@khoitsma
khoitsma / List.md
Last active August 21, 2020 21:27
KLH List

Groceries

  • mustard
  • mayonnaise
  • bacon
  • pickles
  • lettuce
  • tomatoes
  • onions
@khoitsma
khoitsma / boltcapapp.py
Created August 19, 2022 18:06
Per AISC 15th Edition, determine required setback dimensions for bolt holes
def determine_lc_edge_gage_reqd(diameter_label, class_hole):
"""
***************************
diameter_label: for example 'H0750' for 3/4 inch diameter bolt
class_hole: one of these ['STD', 'OVS', 'SSLT', 'LSLT'] standard, oversize, short slot, long slot
***************************
"""
if class_hole not in ['STD', 'OVS', 'SSLT', 'LSLT']:
return [["invalid hole class: " + class_hole]]