Skip to content

Instantly share code, notes, and snippets.

@aplocher
aplocher / simplify3d_ending_script.gcode
Created September 2, 2018 08:43
Simplify 3D G-Code starting script to reduce temp (to reduce oozing), perform homing, auto-leveling, return the temp to the target, and then clean nozzle. Stop script will turn off extruder, bed, move Z up a little bit, move X slightly (so if oozing occurs, hopefully not on the final printed piece), and move Y forward, then turn the fan off afte…
M104 S0 ; turn off extruder
M140 S0 ; turn off bed
G91 ; relative movement
G1 F150 ; slow Z rate
G1 Z10 ; Z up 15mm
G1 X3 ; X 3mm
G1 Y3 ; Y 3mm
G90 ; back to absolute movement
G1 Y200 F1000
M84 ; disable motors
@aplocher
aplocher / Program.cs
Created May 30, 2019 01:25
A simple C# function (and console app) to flatten an array down to a specified generic type
using System;
using System.Collections.Generic;
namespace ConsoleApp3
{
// This is a sample Console App written in C# / .NET Core (but should work with .NET Framework).
// This will flatten an array structure, recursively, down to the generic type specified (or throw an exception if the input is bad)
class Program
{
@aplocher
aplocher / CmderHere.bat
Created January 14, 2020 23:43
Small bat file that will prompt for Cmder's root dir. It will set the CMDER_ROOT env variable and register "Cmder Here" context menu entries in Windows Explorer.
@echo off
net file > NUL 2>&1
if not [%ERRORLEVEL%]==[0] (
echo ERROR - RUN AS ADMIN
echo.
goto :done
)
echo Enter the path to the CMDER folder...
{
"basics": {
"name": "Adam Plocher",
"picture": "https://avatars0.githubusercontent.com/u/1132447?v=4",
"label": "Software Developer at Varis LLC",
"headline": "A motivated and professional software engineer with over 15 years of experience in the industry",
"summary": "Experienced full-stack developer with an appreciation for design patterns.",
"website": "http://blog.bitcollectors.com/adam",
"yearsOfExperience": 19,
"username": "aplocher",
@aplocher
aplocher / data-dict-gen-simple.sql
Created February 8, 2021 22:04
T-SQL script to generate data dict. markdown to be used in Azure DevOps Wiki from a SQL Server table
use varis_p
go
declare
@table varchar(50) = 'dbo.SomeTable'
select md from (
-- Row 1 - Headers
select
-2 as colid,
@aplocher
aplocher / data-dict-gen.sql
Created February 8, 2021 22:10
Generate a complete markdown data dictionary template, including a table of contents, for Azure DevOps wiki from a list of tables. Will also display PK and FK info
use my-database
go
declare @tableList table (Id int not null primary key identity, DatabaseName varchar(50), SchemaName varchar(50), TableName varchar(50), TableDescription varchar(max))
-- #### CONFIGURATION:
-- Which tables to generate the markdown for?
insert into @tableList (DatabaseName, SchemaName, TableName, TableDescription) values
('my-database', 'dbo', 'Entity', ''),