Skip to content

Instantly share code, notes, and snippets.

View MaxAtoms's full-sized avatar
🦤

Thomas M. Schöller MaxAtoms

🦤
View GitHub Profile
@MaxAtoms
MaxAtoms / bash-prompt.sh
Created November 26, 2017 16:54
My bash prompt
PS1='[\[\033[1;33m\]\# \[\033[1;32m\]\u@\H \[\033[1;36m\]\w\[\033[0m\]]\$ '
@MaxAtoms
MaxAtoms / octoprint-plugins.md
Last active November 1, 2019 21:21
These are the OctoPrint plugins that I currently use
@MaxAtoms
MaxAtoms / slic3r_temp_change.md
Created March 9, 2019 20:11
Temperature change at a specific height in Slic3r

If you want Slic3r to generate Gcode with a temperature change at a specific height (e.g. for printing a temperature tower), you will need to add a line of conditional G-code. To do that, click on the Printer Settings tab and in the left sidebar on Custom G-code. In the text field After layer change G-code add a line like the following for each desired temperature change:

{if layer_z==10}M104 S190{endif}

This example changes the extruder temperature at a height of 10mm to 190°C.

@MaxAtoms
MaxAtoms / pdfclitools.md
Last active February 5, 2023 14:33
PDF Command Line Tools
@MaxAtoms
MaxAtoms / settings.json
Last active March 23, 2023 15:11
Visual Studio Code/Code-OSS settings and extensions backup
{
"window.titleBarStyle": "custom",
"workbench.colorTheme": "Night Owl",
"git.autofetch": true,
"terminal.integrated.fontFamily": "'Fira Code'",
"editor.minimap.enabled": false,
"docker.groupImagesBy": "None",
"editor.fontFamily": "'Fira Code', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.fontLigatures": true,
"window.title": "${dirty}${activeEditorMedium}${separator}${rootName}${separator}${appName}",
@MaxAtoms
MaxAtoms / year-in-review.md
Created November 13, 2021 08:53
Git Repos Year-in-review

Git Repos Year-in-review

The following commands and tools can be used to create metrics and visualizations to highlight the work done in the past year.

Number of commits added to the master branch since the start of the year

git rev-list \
--since 2021-01-01 \
--count master
@MaxAtoms
MaxAtoms / CallerAttributes.cs
Last active May 7, 2022 15:43
Trying out C# Caller Attributes
public static class CallerAttributeExtensions
{
public static void WriteCallerAttributeValuesToConsole<T>( this T? obj,
[CallerMemberName] string? member = null,
[CallerFilePath] string? filePath = null,
[CallerLineNumber] int lineNum = 0,
[CallerArgumentExpression("obj")] string? expr = null )
{
Console.Out.WriteLine( $"{member} {filePath} {lineNum} {expr}" );
}
@MaxAtoms
MaxAtoms / delete-duplicate-files.sh
Created March 19, 2023 00:38
Removes duplicate files in the current working directory when their hash matches exactly
#!/bin/bash
declare -A file_hashes
for file in *; do
if [[ -f $file ]]; then
hash=$(sha256sum "$file" | awk '{print $1}')
if [[ ${file_hashes[$hash]} ]]; then
echo "Deleting duplicate file: $file"
rm -i "$file"