Skip to content

Instantly share code, notes, and snippets.

View pladaria's full-sized avatar
👾

Pedro Ladaria pladaria

👾
View GitHub Profile
@pladaria
pladaria / use-is-virtual-keyboard-open.ts
Last active April 29, 2024 18:12
Detect if Virtual Keyboard is open in web app using React
const useIsVirtualKeyboardVisible = () => {
const [isVirtualKeyboardVisible, setIsVirtualKeyboardVisible] = React.useState(false);
React.useEffect(() => {
// probably incomplete, good enough for me
const inputTypesThatOpenTheVirtualKeyboard = ['text', 'email', 'password', 'number', 'search'];
const handleFocus = (event: Event) => {
if (
event.target instanceof HTMLTextAreaElement ||
@pladaria
pladaria / Logitec-z960-IR-codes.md
Created December 12, 2019 11:35
Logitech Speaker System Z906 remote IR codes
@pladaria
pladaria / tesseract-tsv-to-json.js
Created April 8, 2023 11:33
Tesseract OCR tsv to json converter
const tesseractTsvToJson = (tsvFilename, jsonFilename) => {
console.log(`> tsvToJson ${tsvFilename} => ${jsonFilename}`);
const tsvLines = fs.readFileSync(tsvFilename, 'utf-8').trim().split('\n').reverse();
/** @type {any} */
const json = {pages: []};
// discard header
tsvLines.pop();
@pladaria
pladaria / .svgo.yml
Last active February 7, 2023 17:15
SVGO config file
multipass: true
plugins:
- addAttributesToSVGElement: false
- addClassesToSVGElement: false
- cleanupAttrs: true
- cleanupEnableBackground: true
- cleanupIDs: true
- cleanupListOfValues: true
- cleanupNumericValues:
@pladaria
pladaria / vitashell-usb-mount-linux.md
Last active January 19, 2023 11:28
How to mount PSVita in linux using VitaShell and a USB cable
  • Linux Mint 20.2 x86_64
  • Kernel 5.4.0-135-generic

Remove exfat-fuse and exfat-utils packages

sudo apt-get remove exfat-fuse exfat-utils

Install exfat-linux.

@pladaria
pladaria / bo-mx4000-sw2.0-notes.md
Last active January 23, 2022 16:02
Bang & Olufsen MX4000 SW 2.0 Notes
@pladaria
pladaria / riffwave.js
Created December 7, 2016 16:17
RIFFWAVE
/*
* RIFFWAVE.js v0.03 - Audio encoder for HTML5 <audio> elements.
* Copyleft 2011 by Pedro Ladaria <pedro.ladaria at Gmail dot com>
*
* Public Domain
*
* Changelog:
*
* 0.01 - First release
* 0.02 - New faster base64 encoding
@pladaria
pladaria / heroku-deploy.sh
Created January 29, 2017 15:44
Simple shell script to deploy heroku services
#!/usr/bin/env bash
DEPLOY_PATH=/tmp/heroku-deploy-`date +%s`/
HEROKU_NAME="put-your-heroku-service-name-here"
rm -rf $DEPLOY_PATH
mkdir -p $DEPLOY_PATH
rsync -av . $DEPLOY_PATH --exclude node_modules
cd $DEPLOY_PATH
@pladaria
pladaria / fundacion-lectura.md
Last active January 30, 2020 05:52
Saga de la Fundación - Orden de lectura

Saga de la Fundación

Serie de los Robots

  • 1950 Yo, Robot
  • 1954 Bóvedas de Acero
  • 1957 El Sol Desnudo
  • 1983 Los Robots del Amanecer
  • 1985 Robots e Imperio
@pladaria
pladaria / clean-up-boot-partition-ubuntu.md
Created December 20, 2019 09:45 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r