Skip to content

Instantly share code, notes, and snippets.

@manuelbl
manuelbl / README.md
Created August 3, 2019 09:12
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
@ssskip
ssskip / ISO3166-1.alpha2.json
Last active December 16, 2024 15:10
json of country codes (ISO 3166-1 alpha-2) and corresponding names
{
"AF": "Afghanistan",
"AX": "Aland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
@yasershahi
yasershahi / ubuntu-server-post-install.md
Last active December 16, 2024 15:08
Ubuntu Server Initial Setup

Server Setup Instructions

Login via SSH

ssh root@IP
# enter password and hit Return
@Pulimet
Pulimet / AdbCommands
Last active December 16, 2024 15:04
Adb useful commands list
Hi All!
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future.
Feel free to request any features you'd like to see, and I'll prioritize them accordingly.
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it.
Here's the link to the repository: https://github.com/Pulimet/ADBugger
App Description:
ADBugger is a desktop tool designed for debugging and QA of Android devices and emulators. It simplifies testing, debugging, and performance analysis by offering device management, automated testing, log analysis, and remote control capabilities. This ensures smooth app performance across various setups.
@codigoconjuan
codigoconjuan / gulpfile.js
Last active December 16, 2024 15:04
Convertir Imagenes a Webp
export async function imagenes(done) {
const srcDir = './src/img';
const buildDir = './build/img';
const images = await glob('./src/img/**/*{jpg,png}')
images.forEach(file => {
const relativePath = path.relative(srcDir, path.dirname(file));
const outputSubDir = path.join(buildDir, relativePath);
procesarImagenes(file, outputSubDir);
@hightemp
hightemp / gist:11196851
Last active December 16, 2024 15:03
Convert .vdi to .img
vboxmanage clonehd image.vdi image.img --format RAW
qemu-img convert -f vdi -O raw image.vdi image.img
vbox-img convert --srcfilename image.vdi --stdout --srcformat VDI --dstformat RAW image.img

Emacs isn't just an editor, it’s an entire Emacs Lisp interpreter and environment. We can use Emacs Lisp not only to extend and customize our beloved editor, but also to write entire programs and applications. Nic Ferrier’s [elnode][] server is the most ambitious Emacs Lisp application of this sort, but we can start at a smaller scale and try to write our shell scripts and tools with Emacs Lisp.

However, it turns out that writing programs in Emacs Lisp is more intricate than it looks at a first glance. Emacs decades-long history as interactive application have left deep marks in Emacs and Emacs Lisp, which make independent

@richard-flosi
richard-flosi / pin-dependencies-to-current-version.zsh
Created May 21, 2024 13:36
Pin current dependencies versions
#!/bin/zsh
# For each package name
for PACKAGE in `npm pkg get dependencies | jq 'keys[]' | tr -d '"'`
do
echo "Found ${PACKAGE}" &&
# Get the current installed version
VERSION=`npm ls ${PACKAGE} --depth 0 --json | jq --arg package ${PACKAGE} '.dependencies.[$package].version' | tr -d '"'` &&
echo "Current version ${VERSION}" &&

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

# ---- Base python ----
FROM python:3.6 AS base
# Create app directory
WORKDIR /app
# ---- Dependencies ----
FROM base AS dependencies
COPY gunicorn_app/requirements.txt ./
# install app dependencies
RUN pip install -r requirements.txt