Skip to content

Instantly share code, notes, and snippets.

View wbatty's full-sized avatar

Will Batty wbatty

  • Zoom
  • Phoenix, AZ
View GitHub Profile
[gcode_macro TOGGLE_LIGHTS]
gcode:
{% if printer['output_pin caselight'].value %}
SET_PIN PIN=caselight VALUE=0
{% else %}
SET_PIN PIN=caselight VALUE=1
{% endif %}
@wbatty
wbatty / Snapshots.cfg
Last active August 19, 2024 20:52
Example of how to setup Klipper to use the gocode_shell_command to do timelapse (pre mainsail built in timelapse)
# Requires `gcode_shell_command` extension to Moonraker (installing via KIUAH is the easy way)
# Requires gphoto2 http://www.gphoto.org/
[gcode_shell_command gphoto2_trigger_snapshot]
command: gphoto2 --auto-detect --trigger-capture
timeout: 10. ; make sure this is long enough to account for focus time
verbose: True
[gcode_shell_command gphoto2_init_camera]
command: gphoto2 --auto-detect --set-config capturetarget=1
@wbatty
wbatty / Config.ini
Created February 9, 2022 23:19
ABS Config for Ender 5 w/ PEX bed
# generated by SuperSlicer 2.3.57 on 2022-02-09 at 23:15:44 UTC
avoid_crossing_perimeters = 0
avoid_crossing_perimeters_max_detour = 0
bed_custom_model =
bed_custom_texture =
bed_shape = 5x2.5,240x2.5,240x237.5,5x237.5
bed_temperature = 110
before_layer_gcode = ;BEFORE_LAYER_CHANGE\n;{layer_z}\n\n
between_objects_gcode =
bottom_fill_pattern = rectilinear
@wbatty
wbatty / SimpleTableToCsv.html
Created April 1, 2019 15:48
Simple example of converting a HTML table to CSV
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<button class="download-csv" data-download-target="results" data-filename="results.csv"></button>
<table id="results">
<thead>
[
{
"color":{
"caption":"Color",
"type":"string"
},
"Number":{
"type":"number"
},
"Date":{
@wbatty
wbatty / quick-download.js
Created February 21, 2019 18:08
Quick Teamwork Project List Download
const API_KEY = /*Your API Key */;
const PAGE_COUNT = 3; // NUmber of pages to fetch (for some reason fetch does not retrieve headers from teamwork api)
const FIELDS = ['id', 'name']; // fields you want in the CSV
let companyId = /* Your company id*/;
let status = 'ACTIVE';
getPageUrls(PAGE_COUNT, { status, companyId })
.then(fetchPages)