Skip to content

Instantly share code, notes, and snippets.

View NameOfTheDragon's full-sized avatar
🌟
Freelance .NET developer for hire

Tim Long NameOfTheDragon

🌟
Freelance .NET developer for hire
View GitHub Profile
@NameOfTheDragon
NameOfTheDragon / CodeContracts.DotSettings
Last active August 29, 2015 13:56
ReSharper 8 LiveTemplates for Microsoft RiSE Code Contracts
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=043D87E97243F74F986876C4F6810065/@KeyIndexDefined">True</s:Boolean>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=043D87E97243F74F986876C4F6810065/Applicability/=Live/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=043D87E97243F74F986876C4F6810065/Categories/=Contracts/@EntryIndexedValue">Contracts</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=043D87E97243F74F986876C4F6810065/Description/@EntryValue">Contract.Ensures</s:String>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=043D87E97243F74F986876C4F681
@NameOfTheDragon
NameOfTheDragon / switch
Created May 11, 2015 23:32
Example of C# switch statement
switch (variable)
{
case value-1:
// Do something
break;
case value-2:
// Do something
break;
default:
// Do something
@NameOfTheDragon
NameOfTheDragon / AsyncExtensions.cs
Created October 28, 2019 01:34
Useful extensions for async code
// This file is part of the TA.WeatherListener project
//
// Copyright © 2016-2018 Tigra Astronomy., all rights reserved.
//
// File: AsyncExtensions.cs Last modified: 2018-01-08@00:58 by Tim Long
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
; temperature tower: https://www.thingiverse.com/thing:2729076
; appliy the following function in Klipper FW before running the temp tower:
TUNING_TOWER COMMAND="SET_HEATER_TEMPERATURE HEATER=extruder" PARAMETER=TARGET START=227.5 FACTOR=-.5 BAND=10
; This starts at 225deg and every 10mm reduces by 5deg until the top tower hits 180deg.
; Postprocessed by [ArcWelder](https://github.com/FormerLurker/ArcWelderLib)
; Copyright(C) 2020 - Brad Hochgesang
; arc_welder_resolution_mm = 0.10
; arc_welder_g90_influences_extruder = False
; generated by PrusaSlicer 2.3.0-rc2+win64 on 2021-01-07 at 21:15:27 UTC
;
; external perimeters extrusion width = 0.45mm
{"main_settings": {"show_extruder_state_changes": true, "preview_snapshot_plans": false, "auto_reload_latest_snapshot": true, "preview_snapshot_plan_seconds": 30, "show_snapshot_plan_information": true, "snapshot_archive_directory": "", "timelapse_directory": "", "test_mode_enabled": false, "show_printer_state_changes": true, "platform": "unknown", "version": "0.4.1", "automatic_update_interval_days": 30, "cancel_print_on_startup_error": true, "show_navbar_icon": true, "show_navbar_when_not_printing": true, "git_version": "cec243c65a979e8bbe90f09fc5aec6d0844d2d3b", "is_octolapse_enabled": true, "show_trigger_state_changes": true, "temporary_directory": "", "settings_version": "0.4.0", "auto_reload_frames": 30, "automatic_updates_enabled": true, "preview_snapshot_plan_autoclose": false, "show_position_changes": true}, "global_options": null, "profiles": {"logging": {"4d7411e9-f97e-41c0-921c-02e262660e83": {"automatic_configuration": {"key_values": [{"name": "Log Parsing/Preprocessing/Position Tracking", "value
2021-01-08 16:16:33,444 - octolapse.utility - ERROR - Unable to load TimelapseJobInfo from /home/pi/.octoprint/data/octolapse/tmp/octolapse_snapshots_tmp/65bdef87-8269-4b20-94e7-45cbae9178d3/timelapse_info.json.
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_octolapse/utility.py", line 891, in load
with open(file_path, 'r') as timelapse_info:
IOError: [Errno 2] No such file or directory: u'/home/pi/.octoprint/data/octolapse/tmp/octolapse_snapshots_tmp/65bdef87-8269-4b20-94e7-45cbae9178d3/timelapse_info.json'
2021-01-08 16:16:53,529 - octolapse.settings - ERROR - The rendering settings file does not exist for the given snapshot job at /home/pi/.octoprint/data/octolapse/tmp/octolapse_snapshots_tmp/65bdef87-8269-4b20-94e7-45cbae9178d3/354def78-9eea-409a-ad23-ee966dfff4ba/rendering_settings.json.
2021-01-08 16:16:53,567 - octolapse.settings - ERROR - The camera settings file does not exist for the given snapshot job at /home/pi/.octoprint/data/octolapse/
2021-01-08 04:27:54,849 - octoprint.plugins.rgb_status - INFO - Updating Progress LEDs: 37
2021-01-08 04:27:54,858 - octoprint.server - INFO - --- Log roll over detected ---------------------------------------------------
2021-01-08 04:27:54,859 - octoprint.server - INFO - OctoPrint 1.5.2
2021-01-08 04:27:54,864 - octoprint.plugin.core - INFO - 39 plugin(s) registered with the system:
| Action Command Notification Support (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/action_command_notification
| Action Command Prompt Support (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/action_command_prompt
| Active Filters Extended (0.1.0) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_active_filters_extended
| Announcement Plugin (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/announcements
| Anonymous Usage Tracking (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/tracking
| Application Keys Plu
@NameOfTheDragon
NameOfTheDragon / Useful Klipper Macros
Created April 22, 2021 02:23
Klipper gcode macros that I use with my Creality Ender 3
# These macros are required for Fluidd to correctly function.
# You can copy these entries into your printer.cfg.
#
# Alternatively, import this file by adding
# this line into your printer.cfg;
#
# [include client_macros.cfg]
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
# Macros for pausing, resuming and changing filament mid-print.
[gcode_macro M600]
gcode:
CHANGE_FILAMENT
[gcode_macro M601]
gcode:
CHANGE_FILAMENT