Skip to content

Instantly share code, notes, and snippets.

View storopoli's full-sized avatar

Jose Storopoli storopoli

View GitHub Profile
@storopoli
storopoli / com.sparrowwallet.Sparrow.yml
Last active September 20, 2024 11:23 — forked from ziqiq/com.sparrowwallet.Sparrow.md
Sparrow wallet flatpak manifest
# run me with:
# flatpak-builder --force-clean --user --install-deps-from=flathub-verified --install builddir com.sparrowwallet.Sparrow.yml
id: com.sparrowwallet.Sparrow
branch: 2.0.0
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
command: Sparrow
modules:
- name: Sparrow
@storopoli
storopoli / halting_problem.md
Created August 5, 2024 20:06
The Halting problem
fn halts(program: A) -> bool

fn b(program: A) {
    if halts(A) {
        loop {}
    } else {
        return ();
    }
}
@storopoli
storopoli / stack_pinning.rs
Created July 30, 2024 20:36
Getting mutable references to a pinned struct in the stack
use std::pin::pin;
use std::marker::PhantomPinned;
#[derive(Debug)]
struct MyStruct {
field: u32,
_pin: PhantomPinned
}
impl MyStruct {
@storopoli
storopoli / object_safety.rs
Created July 8, 2024 12:38
Rust: Object Safe Traits
// In general there are two properties for traits to satisfy
// in order them to be object-safe:
//
// 1. The return type isn’t Self.
// 2. There are no generic type parameters.
// Here's an example of a non-object-safe Trait
trait MyTrait {
fn f(&self) -> Self;
@storopoli
storopoli / caps-escape-ctrl.json
Created June 30, 2024 11:29
Input Remapper - Capslock Esc/Ctrl Tap/Hold
[
{
"input_combination": [
{
"type": 1,
"code": 58,
"origin_hash": "748e31550c24fc009038438dc4fce338"
}
],
"target_uinput": "keyboard",
@storopoli
storopoli / lnd-invoice-rest.md
Created June 7, 2024 19:12
LND - How to Create an Invoice just with a payment hash and amount

How to Create an Invoice just with a payment hash and amount

You can't do this in the CLI, the addinvoice requires a random 32-byte hex-encoded preimage. But you can do this with the REST API LND interface:

curl --insecure --request POST --data '{"r_hash": "<PAYMENT_HASH>", "value": <INT>}' --header "Grpc-Metadata-macaroon: <INVOICE MACAROON OR HIGHER>" --header "Content-Type: application/json" -v https://localhost:<LND_PORT>/v1/invoices

You need the --insecure flag since it is an https:// endpoint that we cannot validate the TLS certificate.

@storopoli
storopoli / GROQ_API_KEYS.env
Created May 20, 2024 15:32
Open-WebUI Self-Hosted Proxy
GROQ_API_KEY=<REDACTED>
@storopoli
storopoli / bdk_pr_review_club-2024-05-09.md
Last active May 9, 2024 13:13
BDK PR Review Club - 2024-05-09

BDK PR Review Club - 2024-05-09

PR discussed: bitcoindevkit/bdk#1395

  1. Why does BDK needs pseudorandom number generators (PRNG)? Particularly in signing and in building a transaction.

    • Why when signing a tx?

      A: Because of nonces, even if you don't use a PRNG, you get deterministic nonce generated which depends

@storopoli
storopoli / bitcoin-docker.md
Created April 30, 2024 20:34
Running a simple instance of `bitcoind`
  1. Spin the container: docker run --rm --name bitcoin jaonoctus/bitcoind:v26.0 -maxconnections=0
  2. Use the bitcoin-cli from another terminal: docker exec -it bitcoin bitcoin-cli decoderawtransaction true
@storopoli
storopoli / .gitignore
Last active September 19, 2024 08:42
Minimal Neovim config
lazy-lock.json