Skip to content

Instantly share code, notes, and snippets.

View jeanfbrito's full-sized avatar
🌱
Seeding the future!

Jean Brito jeanfbrito

🌱
Seeding the future!
View GitHub Profile
@jeanfbrito
jeanfbrito / frequencytester.md
Created November 15, 2023 15:22 — forked from kmobs/frequencytester.md
Frequency Tester

Frequency Testing

This will allow you to test a specific frequency that you hear when you do your resonance testing in Klipper and potentially track down where extra peaks are coming from. If something is rattling at a specific frequency, you can specify that frequency and feel around the printer until you track it down.

Code was adopted by zifnab from somewhere in Klipper.

Usage

You have to have [resonance_holder] in your printer.cfg.

The command is HOLD_RESONANCE AXIS=<axis> FREQ=int SECONDS=<seconds>

@jeanfbrito
jeanfbrito / index.html
Created July 10, 2023 19:57
Electron window.close() crash
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
<style>
webview {
position: absolute;
@jeanfbrito
jeanfbrito / macros.cfg
Created April 25, 2023 18:07
Ender 3 S1 Pro Klipper
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: BED_MESH_CALIBRATE_BASE
; gcode parameters
variable_parameter_AREA_START : 0,0
variable_parameter_AREA_END : 0,0
; the clearance between print area and probe area
variable_mesh_area_offset : 5.0
; number of sample per probe point
variable_probe_samples : 2
; minimum probe count
@jeanfbrito
jeanfbrito / macros.cfg
Created April 6, 2023 13:56
Klipper macros
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: BED_MESH_CALIBRATE_BASE
; gcode parameters
variable_parameter_AREA_START : 0,0
variable_parameter_AREA_END : 0,0
; the clearance between print area and probe area
variable_mesh_area_offset : 5.0
; number of sample per probe point
variable_probe_samples : 2
; minimum probe count
@jeanfbrito
jeanfbrito / invert.md
Created November 13, 2022 03:50 — forked from arbourd/invert.md
Invert Windows 10 mouse scroll wheel
  1. Open Powershell as an administrator
  2. Run
    Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
  3. Verify that all mice devices have had their FlipFlopWheel attributes set to 1
    Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0
  4. Reboot
@jeanfbrito
jeanfbrito / find_dups.rb
Created September 29, 2021 00:20 — forked from rob-murray/find_dups.rb
Rails find duplicate records
columns_that_make_record_distinct = [:some_id, :another_name]
distinct_ids = Model.select("MIN(id) as id").group(columns_that_make_record_distinct).map(&:id)
duplicate_records = Model.where.not(id: distinct_ids)
@jeanfbrito
jeanfbrito / printer.cfg
Last active July 20, 2024 02:42
Anet A8 Plus Klipper configuration
# This file is an example config file for cartesian style printers.
# One may copy and edit this file to configure a new cartesian
# printer.
# DO NOT COPY THIS FILE WITHOUT CAREFULLY READING AND UPDATING IT
# FIRST. Incorrectly configured parameters may cause damage.
# See docs/Config_Reference.md for a description of parameters.
#####################################################################
@jeanfbrito
jeanfbrito / printer.cfg
Last active June 17, 2024 05:40
Anycubic i3 Mega S Klipper configuration
# This file contains pin mappings for the Anycubic i3 Mega with
# Ultrabase from 2017. (This config may work on an Anycubic i3 Mega v1
# prior to the Ultrabase if you comment out the definition of the
# endstop_pin in the stepper_z1 section.) To use this config, the
# firmware should be compiled for the AVR atmega2560.
# See the example.cfg file for a description of available parameters.
#[gcode_arcs]
#resolution: 0.05
time_to_cook = ARGV[0].to_i
hour_glass_one = ARGV[1].to_i
hour_glass_two = ARGV[2].to_i
def can_cook?(time_to_cook, hour_glass_one, hour_glass_two)
total_time = 0
used_hour_glass_one = hour_glass_one
used_hour_glass_two = hour_glass_two
location_points = [
[-29.640088, -50.764216],
[-29.637486, -50.770814],
[-29.633196, -50.773013]
]
# using Harvesine formula to calculate the distance
# based on https://github.com/alexreisner/geocoder/blob/master/lib/geocoder/calculations.rb#L72
def distance(location_one, location_two)
rad_per_deg = Math::PI/180