Skip to content

Instantly share code, notes, and snippets.

@ChrisHinde
ChrisHinde / SMIME_pub_chrishindefjordse_base64.cer
Last active March 8, 2025 21:23
S/MIME public key for chris@hindefjord.se (Base64)
-----BEGIN CERTIFICATE REQUEST-----
MIIDmjCCAgICAQAwJDEiMCAGCSqGSIb3DQEJARYTY2hyaXNAaGluZGVmam9yZC5z
ZTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBANqR/OsEFI0ohA1LSQoA
VHr7MuHIqdoPp2jKYIxDDuzUH98QUPBjIAnhhWjwG/L6MZpnQhwcU5pAhy8iviPz
j56jkys1xm7KYX+zZrdN9OGFjo9GxKpuS9Ku09JXZQs3mLQnnO3d22LTMaiOrMqX
y71dlEdHbgY5wouxyfRFEJbs8jnqWLraFinhzRIZLFMNg0aj0L53a01+KI1tsZ7Q
H5TmzFmqtfU3dY6X3UmrbX/+lM0tRs1RQ9SubnHlifMv5w2Dd0ZFnvxnlQ4VWDYM
cbyeRVcJ+4ArRLLmxlnFER6BZb4rA0e1Z23yHACsEk5XU68ZKZZOigIMfZDJE3hq
ULniz+XKylaTeK7XcJIyWeY0vOJB2oy245DdXFGFN85MuV5beXXzDJpiW9CCtVzb
pq1W5eQHWKdedGagoVg6sqAIUGje4kPIAfwhKWvGHSj0E1fbp0nXDk6qZb7/vezu
@ChrisHinde
ChrisHinde / pubkey_ChrisHindefjordGmail.asc
Created March 8, 2025 21:11
Public PGP key for chris.hindefjord@gmail.com
-----BEGIN PGP PUBLIC KEY BLOCK-----
xjMEZ8yUahYJKwYBBAHaRw8BAQdA/KJTGSp194pCDv7MB6VosmUrJYH7iGUJY1SM
M0aYUf3NM0NocmlzdG9waGVyIEhpbmRlZmpvcmQgPGNocmlzLmhpbmRlZmpvcmRA
Z21haWwuY29tPsKPBBMWCAA3FiEEVU0oRe9fKoOx1Zl6LFOlm5KD83cFAmfMlGoF
CQWjmoACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRAsU6WbkoPzdz0dAP9hBlWbFZVp
P7CXU/9zaM0WOGV3k01sRjtoCDHA7UTnkgEA4Cx32dqJY8Gr0heg/OyuMX8IxEwB
yDPfZyKaZjIq4gzOOARnzJRqEgorBgEEAZdVAQUBAQdAEs7v6ItvrYa6owqceBNQ
Sel3kTJgehuR4XKkVJftTEkDAQgHwn4EGBYIACYWIQRVTShF718qg7HVmXosU6Wb
koPzdwUCZ8yUagUJBaOagAIbDAAKCRAsU6WbkoPzdx9xAPwMqbs0+MF+/lgt4Rnb
@ChrisHinde
ChrisHinde / pubkey_ChristopherHindefjord.asc
Last active March 8, 2025 21:07
PGP Publik Key for Christopher Hindefjord (chris@hindefjord.se)
-----BEGIN PGP PUBLIC KEY BLOCK-----
xsFNBGS0XPkBEADScm+VxCeY+UOKvIYAnCBA9wQzMgR1SQ1HXQeSwF11gUjKrMAA
6fWoLqXUFnhfUdlPlj65I74GjbMozVEqclT2j+EiVk+XitO5Prw4UDbc0+pIKc4h
Yc++Rnrvg8g9BWJxwYQjJzIH6Krsxc7BqwqVDCtm5vxSuxygJEVQFtXUctG/C3X9
D4maTiRJMBrrMjBQjEpccZLtxbrEG7crAeWAIMjNWS4+HTUW59zs6Nf9kDfCFvy7
RAEXNGsG9bT0i2goVlHlIe+QkSunCsELBUjDvYwKMC/FAAUc+g7u4m2o02GRw2CF
Ik7EvodMnmRjAVx1MWHoOlqDENspfRfEF9gZwr+cMjFy7K/j384W3qfZm8oEKYYb
GRlEK2wxPQhnPUXQ1/bpHsGbK6gGQSp9b+Mm+NQv3Tip7sWJS9bIz/WEsosGD9fi
/UyePaATJnW1ct1Vi0rtNBYbqNAb/Qjan44vxTFRI5TIMqwre1Tzhwf4+8pfHc21
@ChrisHinde
ChrisHinde / instance_grid_random.osl
Last active August 21, 2023 15:26
OSL-script that generates a random (greyscale) value per “instance”
shader InstanceGrid_Random(
point proj = point(u, v, 0) [[string label = "Projection"]],
int cols = 10 [[string label = "Columns", int min=0, int max=1000]],
int rows = 10 [[string label = "Rows", int min=0, int max=1000]],
int utime=1 [[string label = "Time", int min=0, float max=1000, float sliderexponent=2]],
int fulluv = 0 [[string label = "Use full UV", string widget = "boolean"]],
int invert_u = 0 [[string label = "Invert U", string widget = "boolean"]],
int invert_v = 0 [[string label = "Invert V", string widget = "boolean"]],
output color c = 0 [[string label = "Instance ID"]]
)
@ChrisHinde
ChrisHinde / instance_grid.osl
Last active August 21, 2023 15:25
Calculate an "Instance ID" based on UV coordinates
shader InstanceGrid(
point proj = point(u, v, 0) [[string label = "Projection"]],
int cols = 10 [[string label = "Columns", int min=0, int max=1000]],
int rows = 10 [[string label = "Rows", int min=0, int max=1000]],
int fulluv = 0 [[string label = "Use full UV", string widget = "boolean"]],
int invert_u = 0 [[string label = "Invert U", string widget = "boolean"]],
int invert_v = 0 [[string label = "Invert V", string widget = "boolean"]],
output color c = 0 [[string label = "Instance ID"]]
)
{
@ChrisHinde
ChrisHinde / noise_grid.osl
Last active August 21, 2023 15:15
Black and White Cell noise OSL
shader NoiseGrid(
point proj = point(u, v, 0) [[string label = "Projection"]],
float scale=20 [[string label = "Scale", float min=0.001, float max=1000, float sliderexponent=2]],
float utime=1 [[string label = "Time", float min=0.001, float max=1000, float sliderexponent=2]],
output color c = 0
)
{
c = cellnoise(proj * scale, utime);
c = color(c[0], c[0], c[0]);
@ChrisHinde
ChrisHinde / imggen_randompatches.py
Last active August 21, 2023 14:43
Image texture generators for Array Modifier "instance ID"
# imggen_randompatches.py
#
# Python script to generate an image with greyscale "patches"
# from black (0.0 / 0) to white (1.0 / 255) in random order
#
# CC-BY Chris Hindefjord - chris.hindefjord.se - 2023-08
#
# Tested with Python 3.9.2
# NB: Requires the PIL/Pillow library!
#
@ChrisHinde
ChrisHinde / Sam4s_TextToCode.py
Last active September 14, 2021 19:41
Converts a list of strings/descriptions to numeric "descriptor" for (some) Sam4s cash registers.
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Author: Christopher Hindefjord - chris.hindefjord.se
# September 2021
# License: CC-0 (Public domain)
# ===========================
# Converts a list of strings/descriptions to numeric "descriptor" for (some) Sam4s cash registers.
# The character codes are taken from the "Operator's and Programming manual" for Sam4s ER-5200M/5240M!
@ChrisHinde
ChrisHinde / Sharp_TextToCodes.py
Last active September 14, 2021 19:41
Convert text to character codes for (some) Sharp POS/Cash registers
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Author: Christopher Hindefjord - chris.hindefjord.se
# September 2021
# License: CC-0 (Public domain)
# ===========================
# Converts a list of strings/descriptions to numeric character code for (some) Sharp cash registers.
# The character codes are taken from the "Instruction manual" for Sharp XE-A113!
START G-CODE
(Copy the text between the ---'s and paste into "Start G-code" in the settings for the printer in Cura)
---
;start gcode
M118 X48.17 Y45.44 Z90.01 T0
M140 S0 T0
M104 S0 T1