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 /
Created November 15, 2023 15:22 — forked from kmobs/
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.


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

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

jeanfbrito /
Created November 13, 2022 03:50 — forked from arbourd/
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 / 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 ="MIN(id) as id").group(columns_that_make_record_distinct).map(&:id)
duplicate_records = Model.where.not(id: distinct_ids)
jeanfbrito / Capistrano
Created April 21, 2019 01:08 — forked from stevenyap/Capistrano
Capistrano 3 Setup

This guide explains the way to setup a production server using Capistrano.

Setup Capistrano on LOCAL

  • Capistrano is a development gem which assist the developer to run commands on the production server (something like a Heroku toolbelt)
  • Hence, it is installed and configured on developer's computer
# Gemfile

# Use Capistrano for deployment
jeanfbrito /
Created October 2, 2018 13:33 — forked from andywer/
Post Mortem: Postgres outage on 2018-08-20

2018-08-20: Postgres failure

What happened

The PostgreSQL container stopped unexpectedly, was automatically restarted, but suddenly didn't accept any connections anymore. Neither from the API service containers nor from the Macbook over the internet.

Error in logs:

FATAL:  pg_hba.conf rejects connection for host "", user "postgres", database "******", SSL off
jeanfbrito / gist:692b34a2b41850d94147a5a606109c47
Created July 6, 2018 20:23 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup


:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
jeanfbrito / cidades-brasil.json
Created April 8, 2018 06:04 — forked from fernandosavio/cidades-brasil.json
JSON com as cidades brasileira segundo o IBGE.
"Acre": ["Acrel\u00e2ndia","Assis Brasil","Brasil\u00e9ia","Bujari","Capixaba","Cruzeiro do Sul","Epitaciol\u00e2ndia","Feij\u00f3","Jord\u00e3o","M\u00e2ncio Lima","Manoel Urbano","Marechal Thaumaturgo","Pl\u00e1cido de Castro","Porto Acre","Porto Walter","Rio Branco","Rodrigues Alves","Santa Rosa do Purus","Sena Madureira","Senador Guiomard","Tarauac\u00e1","Xapuri"],
"Alagoas": ["\u00c1gua Branca","Anadia","Arapiraca","Atalaia","Barra de Santo Ant\u00f4nio","Barra de S\u00e3o Miguel","Batalha","Bel\u00e9m","Belo Monte","Boca da Mata","Branquinha","Cacimbinhas","Cajueiro","Campestre","Campo Alegre","Campo Grande","Canapi","Capela","Carneiros","Ch\u00e3 Preta","Coit\u00e9 do N\u00f3ia","Col\u00f4nia Leopoldina","Coqueiro Seco","Coruripe","Cra\u00edbas","Delmiro Gouveia","Dois Riachos","Estrela de Alagoas","Feira Grande","Feliz Deserto","Flexeiras","Girau do Ponciano","Ibateguara","Igaci","Igreja Nova","Inhapi","Jacar\u00e9 dos Homens","Jacu\u00edpe","Japaratinga","Jaramataia","Jequi\u00e1 da Praia","Jo
jeanfbrito /
Created March 7, 2018 18:31 — forked from chunlea/
How to use Boostrap 3 input-group in Simple Form

Finally, Simple Form support Boostrap 3. 👏

But I found it still dosen't support some components in Bootstrap 3. Or may be in the future. But I can't wait, so I find a solution to support them. It was inspired by heartcombo/simple_form#531 (comment) .

This is a final solution and I used in my project.


jeanfbrito /
Created February 5, 2018 00:46 — forked from christopher-hopper/
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

jeanfbrito /
Last active July 6, 2017 06:19 — forked from henrik/
Notes from running Dokku on Digital Ocean.

My notes for Dokku on Digital Ocean.

These may be a bit outdated: Since I originally wrote them, I've reinstalled on a newer Dokku and may not have updated every section below.


Install dokku-cli (gem install dokku-cli) for a more Heroku-like CLI experience (dokku config:set FOO=bar).

# List/run commands when not on Dokku server (assuming a "henroku" ~/.ssh/config alias)

ssh henroku dokku