Skip to content

Instantly share code, notes, and snippets.

View afonsoguerra's full-sized avatar

José Afonso Guerra-Assunção afonsoguerra

View GitHub Profile
@gavrilov
gavrilov / readme.md
Last active June 18, 2024 18:33
Obsidian voice recognition with local Whisper model

Obsidian voice recognition with local Whisper model

Install plugin Whisper for Obsidian

plugin's settings:

@lifan0127
lifan0127 / paper-qa-zotero.py
Created March 8, 2023 02:53
Streamlining Literature Reviews with Paper QA and Zotero
import os
os.environ['OPENAI_API_KEY'] = '<Your OpenAI API Key>'
# See here on how to find your Zotero info: https://github.com/urschrei/pyzotero#quickstart
ZOTERO_USER_ID = '<Your Zotero User ID>'
ZOTERO_API_KEY = '<Your Zotero API Key>'
ZOTERO_COLLECTION_ID = '<Your Zotero Collection ID>'
question = 'What predictive models are used in materials discovery?'
# The following prompt instruction is injected to limit the number of keywords per query
@hasezoey
hasezoey / koreader_on_tolino.md
Last active August 19, 2024 16:33
Install KOReader on a Tolino device (Vision 5)

Install KOReader on a Tolino Device

Tolino Debug Menu codes

For KOReader (or any other APK) to be installed on a Tolino device, the debug menu has to be enabled:

  • if the tolino is on system version 14, search for code 124816 source
  • if the tolino is on system version 15, search for code 1123581321 source
  • if the tolino is on system version 16, search for code 112358132fb source

Note: "searching" as in the search for books on the tolino itself (the magnifying glass in the top bar)

@yhatt
yhatt / hide-slides-plugin.js
Last active March 10, 2024 02:00
Marp hide slides plugin example
const marpHideSlidesPlugin = (md) => {
md.marpit.customDirectives.local.hide = (value) => ({
hide: value === 'true',
})
md.core.ruler.after(
'marpit_directives_apply',
'marpit_hide_slides',
(state) => {
let withinSlide = false
@vitiko98
vitiko98 / get_keys.py
Last active March 8, 2024 20:00
Get Qobuz App ID and Secrets
from qobuz_dl.bundle import Bundle
bundle = Bundle()
app_id = bundle.get_app_id()
secrets = "\n".join(bundle.get_secrets().values())
print(f"App ID: {app_id}")
print("#" * 20)
import network
import socket
import time
import struct
from machine import Pin
NTP_DELTA = 2208988800
host = "pool.ntp.org"
// Tailscale Frontend: It uses tailscale-as-a-library to
// listen on a port, independently from the operating system network, i.e. you
// can run an nginx server on :80 and :443 without impacting the frontend.
//
// set up DNS, e.g.:
// prometheus.ts.zekjur.net A 100.117.6.125
//
// frontend% TAILSCALE_USE_WIP_CODE=true tailscalefrontend -hostname=srv.example.net -allowed_user=michael@example.net
//
// (first login requires running with TS_LOGIN=1 environment variable to print link for the browser)
@tararoys
tararoys / Replacement.md
Last active June 16, 2023 15:39
A cheat sheet for learning several of the most useful talon commands
@ednisley
ednisley / config.h
Created January 4, 2021 01:01
QMK files for KeyboardIO Atreus modified with layer-indicating WS2812 RGB LED
#define RGB_DI_PIN B2
#define RGBLED_NUM 1
// https://github.com/qmk/qmk_firmware/blob/master/docs/ws2812_driver.md
//#define WS2812_TRST_US 280
//#define WS2812_BYTE_ORDER WS2812_BYTE_ORDER_GRB
#define RGBLIGHT_LIMIT_VAL 63
#define RGBLIGHT_LAYERS
@caksoylar
caksoylar / combination.md
Last active January 11, 2024 00:43
QMK combination dial lock for entering passwords with a rotary encoder

Creating a combination dial lock with a rotary encoder in QMK

Below is a snippet for implementing a combination dial-like mechanism you can use in your QMK keymap. This is useful for entering long passwords using a rotary encoder, or activating secret macros etc. The algorithm looks for a sequence of clockwise (CW) or counter-clockwise (CCW) turns of the rotary encoder for a certain number of ticks/clicks. It executes the macro if all turns are successfully completed, or resets to the beginning if a turn is too long or too short.

For this example we will output a string as a macro, like entering a password. In this case it is "TA DA!":

void emit_passphrase_secret(void) {