Skip to content

Instantly share code, notes, and snippets.

Avatar
🌱
Seeding the future!

Jean Brito jeanfbrito

🌱
Seeding the future!
View GitHub Profile
@jeanfbrito
jeanfbrito / invert.md
Created November 13, 2022 03:50 — forked from arbourd/invert.md
Invert Windows 10 mouse scroll wheel
View invert.md
  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
View find_dups.rb
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 March 4, 2023 12:52
Anet A8 Plus Klipper configuration
View printer.cfg
# 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 October 11, 2022 02:15
Anycubic i3 Mega S Klipper configuration
View printer.cfg
# 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
View noodle_timer.rb
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
View distance_calculator.rb
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
@jeanfbrito
jeanfbrito / watertank.yaml
Created April 30, 2020 13:53
My watertank ESPHome configuration
View watertank.yaml
esphome:
name: watertank
platform: ESP8266
board: nodemcuv2
wifi:
ssid: "greenhouse"
password: "senhasupersecreta"
# Enable fallback hotspot (captive portal) in case wifi connection fails
@jeanfbrito
jeanfbrito / garden.yaml
Last active February 20, 2022 00:26
My garden ESPHome configuration
View garden.yaml
esphome:
name: garden
platform: ESP32
board: esp-wrover-kit
wifi:
ssid: "greenhouse"
password: "senhasupersecreta"
# Enable fallback hotspot (captive portal) in case wifi connection fails
@jeanfbrito
jeanfbrito / conky.conf
Created April 29, 2020 19:35
My configuration for conky
View conky.conf
-- vim: ts=4 sw=4 noet ai cindent syntax=lua
--[[
Conky, a system monitor, based on torsmo
Any original torsmo code is licensed under the BSD license
All code written since the fork of torsmo is licensed under the GPL
Please see COPYING for details
@jeanfbrito
jeanfbrito / profiles.json
Created April 23, 2020 06:06
My Windows Terminal Configuration
View profiles.json
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
"profiles":