Skip to content

Instantly share code, notes, and snippets.

View mauro1998's full-sized avatar
🎯
Focusing

Mauro Aguilar mauro1998

🎯
Focusing
View GitHub Profile
@mauro1998
mauro1998 / vscode-default-problem-matchers.js
Last active May 20, 2020 23:38
Default problem matchers for vscode tasks
export enum ProblemLocationKind {
File,
Location
}
class ProblemPatternRegistryImpl implements IProblemPatternRegistry {
// ...
private fillDefaults(): void {
this.add('msCompile', {
@mauro1998
mauro1998 / download-video-blob.js
Created November 5, 2024 00:50
POC how to use MediaRecorder API to record and download an HTML video
/** Simple function to record and download an html video using MediaRecorder API */
async function downloadVideoFromBlob(
video,
duration,
filename = "recorded-video.mp4"
) {
if (!video || video.tagName !== "VIDEO") {
console.error("Please provide a valid video element.");
return;
}
@mauro1998
mauro1998 / adb_reverse_port.sh
Created December 10, 2024 05:57
Android ADB Reverse Port Mapping Script: A bash script that automatically sets up reverse port mapping between an Android device/emulator and your local development machine. Useful for mobile app development when you need your Android app to communicate with a locally running development server.
#!/bin/bash
# This script sets up reverse port mapping between an Android device/emulator and the local development machine.
# It is used to allow the Android app to connect to a local development server running on the host machine.
#
# When running the app in development mode on an Android device/emulator, the app tries to connect to
# localhost:$PORT. However, 'localhost' on the device refers to the device itself, not the development
# machine. This script uses ADB (Android Debug Bridge) to set up reverse port mapping so that when the
# app tries to connect to localhost:$PORT on the device, the connection is reversed back to port $PORT
# on the development machine where the actual server is running.