Skip to content

Instantly share code, notes, and snippets.

@cvzi
cvzi / fingerprint_vibration.sh
Last active March 14, 2024 11:15
Disable fingerprint vibration, torch "chop chop" vibration, (and possibly other vibrations) on Android 10 Motorola Moto G7 Power
# Enable USB debugging in the Developer settings and
# then connect phone via USB
# Open a terminal and connect to the phone via:
adb shell
# Lock your phone and then unlock with fingerprint to trigger the vibration.
# List the recent vibrations:
for pkg in $(pm list packages | sed 's/package://');
do
echo "$pkg $(appops get $pkg VIBRATE)" | grep 'time=+[0-9]*s';
done;
# -*- coding: utf-8 -*-
"""
skin_tone_modifiers = {
'LIGHT': '\U0001f3fb',
'MEDIUMLIGHT': '\U0001f3fc',
'MEDIUM': '\U0001f3fd',
'MEDIUMDARK': '\U0001f3fe',
'DARK': '\U0001f3ff',
}
@cvzi
cvzi / worker.js
Last active April 27, 2023 06:53
Telegram Bot on Cloudflare Workers
// new versions at https://github.com/cvzi/telegram-bot-cloudflare
const TOKEN = '123456789:Tnm6EJ8jjk_KhepfI8PlU1n7x0dAAy-QOxO' // Get it from @BotFather https://core.telegram.org/bots#6-botfather
const WEBHOOK = '/endpoint'
const SECRET = 'QUEVEDO_BZRP_Music_Sessions_52' // A-Z, a-z, 0-9, _ and -
/**
* Wait for requests to the worker
*/
addEventListener('fetch', event => {
@cvzi
cvzi / FDroidBuildBadge.js
Created June 1, 2022 11:23
shields.io Badge for current build on F-Droid
/* global addEventListener, Response, fetch */
// http://f-droid-build.cuzi.workers.dev/{package}/
const fetchConfig = {
cf: {
// Always cache this fetch regardless of content type
// for a max of 10min before revalidating the resource
cacheTtl: 10 * 60,
cacheEverything: true
@cvzi
cvzi / FDroidSuggestedRelease.js
Created June 1, 2022 11:22
Get suggested release from F-Droid
/* global addEventListener, Response, fetch */
// https://f-droid-build.cuzi.workers.dev/{package}/
const fetchConfig = {
cf: {
// Always cache this fetch regardless of content type
// for a max of 60min before revalidating the resource
cacheTtl: 60 * 60,
cacheEverything: true
@cvzi
cvzi / playStoreBadge.js
Last active March 5, 2023 11:38
Play Store badge with shields.io endpoint, runs as a Cloudflare worker
/*
https://github.com/cvzi/play/
Copyright (C) 2022 cuzi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@cvzi
cvzi / eBay - Hilight Items With Bids.user.js
Created April 3, 2022 18:51
eBay - Hilight Items With Bids - Userscript
// ==UserScript==
// @name eBay - Hilight Items With Bids
// @namespace http://userscripts.org/users/126140
// @include https://*.ebay.*/*
// @grant unsafeWindow
// @version 2.4.0
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @description Highlights items that have bids with a red border and yellow background.
// ==/UserScript==
@cvzi
cvzi / requirements.py
Last active March 22, 2023 14:09
Find updates for packages in requirements.txt on pypi
"""
requirements.py - find updates for packages in requirements.txt on pypi
https://github.com/cvzi/requirements
Copyright (C) 2021 cvzi <cuzi@openmail.cc>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@cvzi
cvzi / pre-commit
Last active November 10, 2022 13:01
pre-commit hook for JavaScript Standard Style on Windows
#!/bin/sh
#
# Check staged .js files with standard (https://standardjs.com)
# Run with --all/-A to check all tracked *.js files, not just staged
#
if [ "$1" != "--all" ] && [ "$1" != "-A" ]; then
fileList=$(git diff --cached --name-only --diff-filter=ACM | grep ".js$")
else
fileList=$(git ls-tree --full-tree -r --name-only HEAD | grep ".js$")
@cvzi
cvzi / colorsInTerminal.py
Created August 21, 2020 20:31
List all colors available in your terminal or console with VT100 virtual terminal sequences
"""
List all colors available in your terminal with VT100 sequences
"""
from __future__ import print_function
import ctypes
if hasattr(ctypes, 'WinDLL'):
# In some Windows consoles you need to enable support for theses sequences. See:
# Enable VT100 sequences "Console Virtual Terminal Sequences" for colored font/background in the Windows terminal