Skip to content

Instantly share code, notes, and snippets.

View dov's full-sized avatar

Dov Grobgeld dov

  • Rehovot, Israel
View GitHub Profile
@dov
dov / fish-to-cq.py
Last active March 20, 2024 21:06
Proof of concept importing svg into CadQuery
#!/usr/bin/python
######################################################################
# A proof of concept adding a svg path into a cadQuery Workspace
# object.
#
# This file is in the public domain.
#
# Dov Grobgeld <dov.grobgeld@gmail.com>
# 2024-03-10 Sun
@dov
dov / ocp-fillet-corner.py
Created March 14, 2024 07:56
Creating fillets with OCP
#!/usr/bin/python
######################################################################
# Example of how to use ChFi2d_FilletAPI to create fillets.
#
# 2024-03-14 Thu
# Dov Grobgeld <dov.grobgeld@gmail.com>
#
# This file is in the public domain
######################################################################
@dov
dov / shampoo-holder.py
Created February 10, 2024 22:01
A shampoo holder created with CadQuery
#!/usr/bin/env python
######################################################################
# A cup holder
# 2024-02-10 Sat
# Dov Grobgeld <dov.grobgeld@gmail.com>
#
# This code is in the public domain.
#
# The shower pole shampoo holder is built as follows
@dov
dov / create_triangle_gltf.cpp
Created February 25, 2021 21:03
Example of how to build a gltf file from scratch with tiny_gltf.h
// An example of how to generate a gltf file from scratch. This example
// was translated from the pygltlib documentation in the pypi project page,
// which in turn is based on the Khronos Sample Models at:
//
// https://github.com/KhronosGroup/glTF-Sample-Models
//
// This example is released under the MIT license.
//
// 2021-02-25 Thu
// Dov Grobgeld <dov.grobgeld@gmail.com>
@dov
dov / toggle-backslash.el
Created October 25, 2023 13:08
Toggle between backslashes and forward slashes
(defun toggle-backslash-line ()
"Toggle all forward slashes to backslashes for the current line."
(interactive)
(save-excursion
(if (use-region-p)
(setq myBoundaries (cons (region-beginning) (region-end)))
(setq myBoundaries (bounds-of-thing-at-point 'line)))
(save-restriction
(goto-char (car myBoundaries))
@dov
dov / shell-command-on-buffer.el
Created October 25, 2023 07:39
Evaluate the current file in local or remote shell
(if (string-match "x86_64-w64-mingw32" system-configuration)
(setq temp-dir "C:/Temp")
(setq temp-dir "/tmp"))
(defun shell-command-on-buffer (command extension)
"Send the current buffer to a shell command"
(interactive)
(let* ((remote-maybe (file-remote-p default-directory))
(tramp-prefix (if remote-maybe remote-maybe ""))
(cmd-buffer-name (concat "*" (capitalize command) " Output*"))
@dov
dov / compile_commands.json
Created October 5, 2022 20:39
Continue debugging clang and eglot
This file has been truncated, but you can view the full file.
[
{
"directory": "/terra/space/pub-repos/PacktPublishing/3D-Graphics-Rendering-Cookbook/build",
@dov
dov / eglot-buffer.txt
Created October 5, 2022 20:27
eglot problems
[internal] Wed Oct 5 23:20:01 2022:
(:message "Running language server: (clangd -j 1 --log=verbose)")
[client-request] (id:1) Wed Oct 5 23:20:01 2022:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
(:processId 16719 :rootPath "/terra/space/pub-repos/PacktPublishing/3D-Graphics-Rendering-Cookbook/" :rootUri "file:///terra/space/pub-repos/PacktPublishing/3D-Graphics-Rendering-Cookbook" :initializationOptions #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
())
:capabilities
(:workspace
(:applyEdit t :executeCommand
(:dynamicRegistration :json-false)
@dov
dov / dummy
Created September 8, 2022 21:23
An image gist
dummy
@dov
dov / gamepad-goocanvas-example.py
Created November 30, 2020 21:50
Example of how to move two circles on a goocanvas with a gamepad
#!/usr/bin/python
######################################################################
#
# An example of how to use the gamepad as an input device for
# python.
#
# The example shows two dots that can be controlled by the
# left and the right joystick on a gamepad.
#
# This may be used as the basis for any analog output. E.g. to