Skip to content

Instantly share code, notes, and snippets.

@dmgerman
dmgerman / ExportLenParam.py
Last active February 1, 2025 17:59
sets len to a list of values, then exports a stl for each
"""This file acts as the main module for this script."""
import traceback
import adsk.core
import adsk.fusion
import os
# import adsk.cam
# Initialize the global variables for the Application and UserInterface objects.
app = adsk.core.Application.get()
dmg_all_keys = {"cmd", "alt", "ctrl"}
hs.console.consoleFont({
__luaSkinType = "NSFont",
name = "Menlo-Regular",
size = 18.0
})
hs.hotkey.bind(
@dmgerman
dmgerman / version-init.el
Created October 26, 2024 18:33
Version Init
(message "what is going on")
(setq package-enable-at-startup nil)
;;; REMEMBER: they are in reverse mode!
(add-to-list 'load-path "~/.emacs.d/org-mode/lisp")
(add-to-list 'load-path "~/.emacs.d/modules/org-roam")
(add-to-list 'load-path "~/.emacs.d/modules/consult")
@dmgerman
dmgerman / org-agenda-custom.el
Last active December 18, 2024 07:02
Org Agenda Custom
(defun dmg-agenda-section-test (parm)
"Generate a custom section to be inserted into the agenda. Takes an optional PARM parameter."
(message "Parm --------------[%S]" parm)
(let (
(original-pt (point))
(inhibit-read-only t)
)
(goto-char (point-max))
(let (
(pt (point))
(use-package org-transclusion
  :ensure t
  )

(require 'org-transclusion-http)

(add-to-list 'org-transclusion-extensions 'org-transclusion-http)
(add-to-list 'org-transclusion-extensions 'org-transclusion-html)
;(add-to-list 'org-transclusion-extensions 'dmg-org-transclusion-function)
@dmgerman
dmgerman / extract-fields.el
Created June 25, 2024 02:01
Extract Fields from org-roam template
(defun org-roam-template-extract-fields (template)
"return a list with the names of the fields used
in the given template"
(let (
(result '())
(pos 0)
)
(while (string-match "\\${\\([^}]+\\)}" template pos)
;; position should be saved first, since
@dmgerman
dmgerman / org-roam-dangling-dyn-block.org
Last active June 8, 2024 20:17
dynamic block for listing Dangling links
(defun dmg-org-roam-danling-links  (&optional limit)
  (let (
        (lim (or limit 25))
        )
    (unless (integerp lim)
      (error "limit should be nil or an integer"))
    (org-roam-db-query
     (format 
@dmgerman
dmgerman / retrieve-fields.org
Last active May 28, 2024 21:07
Retrieve Fields of a node for a template

formatting fields for presentation

  • The way the nodes are processed for the template is very slow.
  • To test how slow, I replaced the code and returned the value of the field without any extra manipulation

    See below

  • With these changes, the take home:
@dmgerman
dmgerman / test-node-constructor.org
Created May 26, 2024 18:45
Test Node Constructor #org
(defun test-node-creation-original (rows)
    (cl-loop for row in rows
             append (pcase-let* ((`(,id ,file ,file-title ,level ,todo
                                        ,pos ,priority ,scheduled ,deadline
                                        ,title ,properties ,olp  ;;12
                                        ,atime ,mtime ,tags ,aliases ,refs)
                                  row)
                                 (all-titles (cons title aliases)))
                      (mapcar (lambda (temp-title)
@dmgerman
dmgerman / node-constructor.el
Last active May 24, 2024 05:24
New Node Constructor
(cl-defstruct (org-roam-node (:constructor org-roam-node-create)
(:constructor org-roam-node-create-from-db
(title aliases ; 2
id file file-title level todo ; 5
point priority scheduled deadline properties ;;5
olp file-atime file-mtime tags refs)) ;;5
(:copier nil))
"A heading or top level file with an assigned ID property."
file file-title file-hash file-atime file-mtime ;5
id level point todo priority ; 5