Skip to content

Instantly share code, notes, and snippets.

@psmay
psmay / renonce-fritzing-part.sh
Last active August 2, 2016 20:26
Script that unpacks Fritzing part fzpz files and replaces their 128-bit hex nonce with one newly generated by uuidgen. Useful for preventing name collisions when creating a modified copy of an existing part.
FZPZ="$1"
die () {
echo "$1" >&2
exit 2
}
die_if_blank () {
@psmay
psmay / Program.cs
Last active March 8, 2020 23:06
For ConfigurationBuilder.AddInMemoryCollection(), one possibility for utilizing arbitrary <string, object> mappings
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
namespace AddingStringObjectDictionaryToConfiguration
@psmay
psmay / mpmd-magnetic-clip.scad
Last active January 28, 2021 19:04
MPMD Magnetic Bed Clip plus way too many parameters
/*
MPMD Magnetic Bed Clip plus way too many parameters
Copyright © 2021 Peter S. May
Based on MPMD adjustable magnetic bed clip v6 by ksihota
https://www.thingiverse.com/thing:3412636
Licensed under Creative Commons - Attribution 4.0
@psmay
psmay / mpmd-magnetic-clip-mod.stl
Last active February 28, 2021 21:33
MPMD Magnetic Bed Clip with separate two-piece anchor (Loosely based on https://www.thingiverse.com/thing:3412636 by ksihota, CC-BY 4.0.) See comments.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
using System;
using System.Collections.Generic;
using System.Linq;
namespace PSMay.Experiments.MoreZipGist
{
// NB: This is a work in progress. It's not fully tested, but it might be good for an idea or two.
//
// To the extent possible under law, the author(s) have dedicated all copyright and related and
// neighboring rights to this software to the public domain worldwide.This software is