Skip to content

Instantly share code, notes, and snippets.

@sanmadjack
sanmadjack / klipper_ender3_skrminie3v2_bltouch_sprite_sfsv2_printer.cfg
Created August 18, 2025 05:25
Klipper Ender 3 Sprite SKR Mini E3 V2.0 BLTouch SFS V2 Printer Config
################################################################
# Configuration for printer composed of:
# Creality Ender 3
# SKR Mini E3 v2 Mainboard
# Raspberry Pi 3 Model B Plus Rev 1.3
# Bltouch bed level sensor
# Creality Sprite Extruder Pro
# BTT SFS V2.0 Smart Filament Sensor
################################################################
# Custom macros are used to contain standardized code, slicer gcode calls these macros.
@sanmadjack
sanmadjack / klipper_ender6_skrminie3v2_bltouch_microswiss_sfsv2_printer.cfg
Last active July 21, 2025 21:34
Klipper Ender 6 Microswiss SKR Mini E3 V2.0 BLTouch SFS V2 Printer Config
################################################################
# Configuration for printer composed of:
# Creality Ender 6
# SKR Mini E3 v3 Mainboard
# Raspberry Pi 3 Model B Plus Rev 1.3
# Bltouch bed level sensor
# Micro Swiss NG™ Direct Drive Extruder for Creality Ender 6
# BTT SFS V2.0 Smart Filament Sensor
################################################################
# Custom macros are used to contain standardized code, slicer gcode calls these macros.
#!/bin/bash
for key in "$@"
do
key="$1"
flipSubs=false
tenbit=false
case $key in
@sanmadjack
sanmadjack / fit_within.dart
Created July 19, 2017 19:39
Dart function to fit a rectangle represented by a point
/// Calculates the size of a rectangle that fits within the confines of another
/// rectangle the size of the dimensions described by [outer] with the same
/// aspect ratio as the rectangle described by [inner].
Point fitWithin(Point inner, Point outer) {
final double outerRatio = outer.x/outer.y;
final double innerRatio = inner.x/ inner.y;
if(outerRatio<innerRatio) {
final num x = outer.x;
final num y = inner.y * (outer.x/inner.x);
@sanmadjack
sanmadjack / filechooserdialogexample.cs
Created September 4, 2014 14:45
FileChooserDialog GTK# C# Example
FileChooserDialog fcd = new FileChooserDialog ("Choose files",this, FileChooserAction.Open,
"Select", ResponseType.Ok, "Cancel", ResponseType.Close);
fcd.SelectMultiple = true;
fcd.Run (); // This opens the window and waits for the response
fcd.Destroy (); // The dialog does not automatically close when clicking the buttons, so you have to manually close it with this
@sanmadjack
sanmadjack / ResizeListViewHeight.cs
Created August 11, 2014 15:04
Android C# function to resize ListView height to match contents
private void ResizeListViewHeight(ListView lv) {
IListAdapter la = lv.Adapter;
if (la == null) {
return;
}
int totalHeight = 0;
DisplayMetrics dm = new DisplayMetrics();
@sanmadjack
sanmadjack / Google.gpl
Created February 6, 2014 16:12
A GIMP and Inkscape Color Pallet for Google Colors
GIMP Palette
Name: Google Colors
Columns: 3
# Created by Matthew Barbour
# Based on Google colour guidelines from http://www.behance.net/gallery/Google-Visual-Assets-Guidelines-Part-1/9028077
66 133 244 Blue 1
118 167 250 Blue 2
160 195 255 Blue 3
219 68 55 Red 1
229 115 104 Red 2
@sanmadjack
sanmadjack / toDni.js
Last active August 29, 2015 13:56
A JavaScript function that takes a decimal-format number and outputs the D'Ni (base-25) equivalent digits. Returns an array containing integer representations of each D'Ni digit.
function convertToDni(number) {
var new_number = new Array();
// If the number is just 0, then we just save some time and output a zero
if(number==0) {
new_number.unshift(0);
return new_number;
}
// D'Ni is base-25, so we divide by 25 over and over again, depositing the remainders into the new number,
// until the number is finally less than 25 (meaning dividing it by 25 floors to 0
while(number>0) {
@sanmadjack
sanmadjack / sysinfo.motd.pl
Last active April 7, 2022 21:02
A MOTD script for displaying system information.
#!/usr/bin/perl
use Data::Dumper;
sub GetIpAddresses{
my $output = qx(ifconfig);
my $hash = {};
my $interface;
foreach my $line (split /[\r\n]+/, $output) {
if($line =~ m/^([^ ]+)/) {
@sanmadjack
sanmadjack / crossword.html
Created September 26, 2013 21:23
A crossword puzzle solving assistant
<html>
<head>
<script>
function process() {
var element = document.getElementById("input");
var input = element.value;
var data = new Array();