Skip to content

Instantly share code, notes, and snippets.

View ShaneDelmore's full-sized avatar

Shane Delmore ShaneDelmore

View GitHub Profile
@ShaneDelmore
ShaneDelmore / extract_json_from_sqlite.py
Created February 27, 2025 06:01
MakeraCAM sqlite db to fusion 360 tool library json format
import json
import math
import re
import sqlite3
def extract_flute_length(name):
"""Extract flute length from tool name using a pattern like '2*12mm Drill' -> 12mm."""
match = re.search(r"(\d+(\.\d+)?)\*\s*(\d+(\.\d+)?)mm", name)
if match:
@ShaneDelmore
ShaneDelmore / instructions.md
Last active March 11, 2025 23:46
Add fan and accel multipliers to Klipper/Mainsail

Install klipper-virtual-pins

bash
cd ~
git clone https://github.com/pedrolamas/klipper-virtual-pins.git
./klipper-virtual-pins/install.sh

Add virtual pins to printer.cfg

1
Cargo.lock
Cargo.toml
src
target
1
Cargo.lock
Cargo.toml
src
target
@ShaneDelmore
ShaneDelmore / typeclass.scala
Created June 20, 2018 00:05
Typeclass example
trait Longable{ def toLong(): Long }
implicit class IntCanLong(int: Int) extends Longable {
def toLong(): Long = int.toLong
}
implicit class StringCanLong(str: String) extends Longable {
def toLong(): Long = str.toInt.toLong
}
@ShaneDelmore
ShaneDelmore / foo.scala
Created June 19, 2018 22:58
Disable good code red in intellij (keywords: squigglies, squiggley, squiggle, disable, suppress)
/*_*/
val 1 = "Hello"
/*_*/
@ShaneDelmore
ShaneDelmore / &&.scala
Created January 29, 2018 16:28 — forked from olafurpg/&&.scala
Having fun with Scala extractor objects. The && combinator can be used to merge multiple extractors into one MEGA extractor.
object && {
def unapply[A](e: A) = Some(e -> e)
def test() {
val greaterThan10 = Find[Int](_ > 10)
List(1, 2, 11, 3) match {
// All must succeed
case greaterThan10(ten) && Last(last) && Head(head) =>
println(ten) // 11
println(last) // 3
#!/bin/bash
#echo "Start Export Process"
#echo "Log into Keybase..."
keybase login
#echo "Exporting your PGP keys..."
keybase pgp export -o keybase.public.key
keybase pgp export -s -o keybase.private.key
@ShaneDelmore
ShaneDelmore / tut.md
Created May 1, 2017 17:14
Single threaded executor for Tut docs
import scala.concurrent.Future
import java.util.concurrent.Executor
import scala.concurrent.ExecutionContext
//Please don't do this in production code!  It is used to execute
//the documentation code synchronously to generate more readable output
implicit val synchronousExecutionContext = ExecutionContext.fromExecutor(new Executor {
  def execute(task: Runnable) = task.run()
})
@ShaneDelmore
ShaneDelmore / clippy.json
Created April 27, 2017 21:08
Imclipitly Matryoshka
{
"version":"0.1",
"advices":[{
"error":{
"type":"notAMember",
"what":"value step",
"notAMemberOf":".*Partial.*"
},
"text":"You may need to import matryoshka.instances._",
"library":{