Skip to content

Instantly share code, notes, and snippets.

View wil92's full-sized avatar
🎯
Focusing

Guillermo wil92

🎯
Focusing
View GitHub Profile
@wil92
wil92 / usb_hid_keys.h
Created November 22, 2023 12:51 — forked from MightyPork/usb_hid_keys.h
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@wil92
wil92 / clean.sh
Created September 10, 2020 10:41
#!/bin/bash
# by wil92
# remove the noise of an audio
# list of needed packages
PACKAGES=("sox" "libsox-fmt-ao" "libsox-fmt-mp3" "libsox-fmt-pulse" "libsox-fmt-alsa" "libsox-fmt-base" "libsox-fmt-oss");
# install dependencies if they are not installed already
for i in "${PACKAGES[@]}"
n = 20
criba = []
for i in range(n):
criba.append(True)
def calculate_criba():
criba[0] = criba[1] = False;
for i in range(2, n):
if criba[i] :
const crypto = require('crypto');
function createHash(text, key) {
return crypto.createHmac('sha256', key).update(text).digest('base64');
}
function createJwt(payload, key) {
const head = Buffer.from(JSON.stringify({alg: "HS256", typ: "JWT"})).toString('base64');
payload = Buffer.from(JSON.stringify({
...(payload || {}),
@wil92
wil92 / SoftKeyboard.java
Created October 6, 2017 16:56 — forked from felHR85/SoftKeyboard.java
A solution to catch show/hide soft keyboard events in Android http://felhr85.net/2014/05/04/catch-soft-keyboard-showhidden-events-in-android/
/*
* Author: Felipe Herranz (felhr85@gmail.com)
* Contributors:Francesco Verheye (verheye.francesco@gmail.com)
* Israel Dominguez (dominguez.israel@gmail.com)
*/
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import android.os.Handler;