Skip to content

Instantly share code, notes, and snippets.

View iddar's full-sized avatar
🤹‍♂️
code juggling

Iddar Olivares iddar

🤹‍♂️
code juggling
View GitHub Profile
@iddar
iddar / README.md
Created August 12, 2024 21:05 — forked from manuelbl/README.md
ESP32 as Bluetooth Keyboard

ESP32 as Bluetooth Keyboard

With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.

For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.

In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:

  1. Go to your computers/phones settings
  2. Ensure Bluetooth is turned on
@iddar
iddar / ai_channels.md
Created February 19, 2024 00:18
Interesting list of YT channels about AI
@iddar
iddar / fast_speech_text_speech.py
Created February 16, 2024 04:13 — forked from thomwolf/fast_speech_text_speech.py
speech to text to speech
""" To use: install LLM studio (or Ollama), clone OpenVoice, run this script in the OpenVoice directory
git clone https://github.com/myshell-ai/OpenVoice
cd OpenVoice
git clone https://huggingface.co/myshell-ai/OpenVoice
cp -r OpenVoice/* .
pip install whisper pynput pyaudio
"""
from openai import OpenAI
import time
@iddar
iddar / remove_quarantine.md
Last active September 17, 2022 05:59
[FIX] Remove all files in a folder no more can’t be opened because Apple cannot check it for malicious software.

Run follow command in a folder

find . -maxdepth 1 -perm -111 -type f | xargs -n 1 -I{} xattr -d com.apple.quarantine {}
@iddar
iddar / Calc_if.php
Last active August 17, 2022 21:43
Ejercicio
<?php
var_dump($_POST);
$total = 0;
if (isset($_POST['operador'])) {
$op = $_POST['operador'];
if ($op == "divi") {
$total = $_POST['izq'] / $_POST['derc'];
} elseif ($op == "suma") {
$total = $_POST['izq'] + $_POST['derc'];
} else {
const getNextVideo = () => {
setNextLoading(true)
for (let i = 0; i < lessons.length; i++) {
WatchedLessons.WatchedVideo(lessons[i].doc ?? '', user?.uid).then(res => {
if (res) {
setNext(lessons[i + 1])
}
})
setNextLoading(false)
}
@iddar
iddar / RAID_GUIDE.md
Created June 23, 2020 23:06
Setup fake Intel Raid on linux

Ultra basic setup

  • Install tooling apt install dmraid
  • Active raed with sudo dmraid -a y
  • use Disks for edit mount point and lebel

Tip

For clean df list use

@keyframes backInRight {
0% {
transform: translateX(400px) scale(1);
opacity: 0.7;
}
80% {
transform: translateX(0px) scale(1);
opacity: 0.7;
}
@iddar
iddar / flameshot.md
Last active April 9, 2020 18:24
flameshot config

If you need or want to replace the PrtScr shortcut do the following:

1.- Release the PrtScr binding by this command gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot '[]'

2.- Go to Settings -> Devices -> Keyboard and scroll to the end. Press + and you will create custom shortcut.

3.- Enter name: "flameshot", command: /usr/bin/flameshot gui.

4.- Set shortcut to PrtScr (print).

@iddar
iddar / write_express_routes.js
Created August 29, 2019 13:53
export express routes
function getTrue(obj) {
return Object.keys(obj).filter(el => obj[el])
}
const fs = require('fs')
const stream = fs.createWriteStream("routes_file.txt")
stream.once('open', function(fd) {
api.stack.forEach(function(r){