Skip to content

Instantly share code, notes, and snippets.

View edersonbadeca's full-sized avatar
💭
Creating a better world line by line

Ederson Badeca edersonbadeca

💭
Creating a better world line by line
View GitHub Profile
@edersonbadeca
edersonbadeca / logi-options-uninstaller.sh
Created October 25, 2024 00:00
LogiOptions remover
#!/bin/bash
# Terminate Logi Options if running
echo "Terminating Logi Options..."
pkill -f LogiOptions
# Remove Logi Options app
echo "Removing Logi Options from Applications directory..."
rm -rf /Applications/LogiOptions.app
@edersonbadeca
edersonbadeca / sketch.ino
Created October 18, 2024 01:43
Arquivo do código C++ para ESP32 - sketch.ino
#include <Arduino.h>
#include "modelo_iris.h" // Inclua o arquivo gerado pelo microgenml
Eloquent::ML::Port::DecisionTree dt;
// Definir os pinos dos potenciômetros
#define POT1_PIN 34 // Potenciômetro 1 (Comprimento da Sépala)
#define POT2_PIN 35 // Potenciômetro 2 (Largura da Sépala)
@edersonbadeca
edersonbadeca / branches-cleaner.sh
Created October 14, 2024 14:32
Git branches cleaner
#!/bin/bash
EXCEPT_BRANCHES=("main")
usage() {
echo "Usage: $0 --except 'branch1 branch2 ...'"
exit 1
}
while [[ "$#" -gt 0 ]]; do
@edersonbadeca
edersonbadeca / adjust-notification-center-position.scpt
Created October 8, 2024 17:46
adjust-notification-center-position.scpt
tell application "System Events"
tell application process "NotificationCenter"
repeat while true
if exists window "Notification Center" then
try
repeat with theWindow in (get windows whose name is "Notification Center")
set displaySize to size of theWindow
set notifSize to size of UI element 1 of scroll area 1 of group 1 of theWindow
set currentPos to position of theWindow
set newPos to {-((first item of displaySize) - (first item of notifSize)) / 2, ((second item of displaySize) - (second item of notifSize) - 56)}
@edersonbadeca
edersonbadeca / badwolf.itermcolors
Created May 10, 2023 13:32 — forked from mattijs/badwolf.itermcolors
badwolf iTerm2 colors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.07884746789932251</real>
<key>Green Component</key>
<real>0.081504985690116882</real>
@edersonbadeca
edersonbadeca / deploy-per-hour.py
Created June 16, 2022 16:57
calculate deploy per hour dora metrics
# coding: utf-8
# This sample code shows how to create a timeseries based on date periods to calculate
# the frequency that an event occurs in a hour.
# Links:
# - https://pandas.pydata.org/docs/reference/api/pandas.date_range.html
# - https://pandas.pydata.org/docs/getting_started/intro_tutorials/09_timeseries.html?highlight=resample#resample-a-time-series-to-another-frequency
import pandas as pd
import numpy as np
@edersonbadeca
edersonbadeca / checkInputNumber.js
Created March 18, 2022 18:03
Check if the input value in between the attribute props
document.querySelectorAll('input[type=number]').forEach(input => {
input.addEventListener('change', (e) => {
const value = e.target.value
const props = e.srcElement.attributes
console.log(`${props.min.value} ${props.max.value} ${value}`)
if (value <= props.min.value || value >= props.max.value) {
alert('valor muito baixo')
}
})
})
@edersonbadeca
edersonbadeca / pomodoro
Created March 16, 2022 14:54
Pomodoro for macbook
to displayError()
display dialog "The script encountered a problem."
end displayError
set rightNow to (get current date)
set hoursNow to hours of rightNow
try
repeat while true
#display dialog hoursNow
if (hoursNow > 17) then
@edersonbadeca
edersonbadeca / water
Created March 16, 2022 14:53
Water reminder - mac script
try
repeat while true
say "Drink water now"
delay 300
end repeat
end try
@edersonbadeca
edersonbadeca / datediff.py
Created March 14, 2022 17:33
Python date diff
# coding: utf-8
d = date(2022, 2, 22)
d1 = date(2022, 3, 4)
abs(d-d1).days