Skip to content

Instantly share code, notes, and snippets.

@1ma
1ma / transfer.bean
Created September 18, 2024 19:50
Exemple de traspàs a Beancount
option "title" "Experiments traspassant fons d'inversió"
option "operating_currency" "EUR"
option "booking_method" "FIFO"
plugin "beancount.plugins.implicit_prices"
2020-01-01 open Assets:Efectiu EUR
2020-01-01 open Assets:BrokerX:FonsABC ABC.FI
2022-01-01 open Assets:BrokerY:FonsDEF DEF.FI
@1ma
1ma / Caddyfile
Last active August 25, 2024 10:23
Caddy Mempool config Goodenough™
:80 {
root /var/www/mempool/browser
handle /api/v1/* {
reverse_proxy 127.0.0.1:8999
}
handle /api/* {
uri replace /api/ /api/v1/
reverse_proxy 127.0.0.1:8999
const fs = require('fs');
const SAMPLE_CONFIG_FILE_NAME = 'mempool-config.sample.json';
const CONFIG_FILE_NAME = 'mempool-config.json';
const settings = {};
const args = process.argv.slice(2);
let sourcePath = SAMPLE_CONFIG_FILE_NAME;
let destinationPath = CONFIG_FILE_NAME;
@1ma
1ma / pubkey.asc
Created June 29, 2024 22:29
My PGP public key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFU32dgBEACcXtiSiNI2nsDnfVmyZ+Kwpp7Pk2P51M1116E1DH5Nbn5PqalG
ALWrK8ZhQpJev75G0Ufee6SmLp/eYPdWLNVL0ZBpDZXwzj7Dpp4qlb31XKhJ0hiO
CzjudUiI1JOLfd4VLCHJdOI5CQhSvkypQZHvRzMyowALa0Aej0sHKdTHkyX9I90b
ThQZka6HSLpptiCs4+XtwTzbbc8/m6FNB1Oe2qvXz57eh4It9XU6C3b/8udQWp0f
RP77PAsylIQ/voBorZMEqityjWx3PJLd8iZTGzYxnXU02QpG2f7Ud5xTxf/b30Zp
GrpS8kiidgjUop4T+5R9t2rJqsNBNwpyN8lu2vFukQI8CMAFLnDQyRmlspmZIvb6
IOtBfZe41YNIrRrDT7GR382hEzXDujntEJentuXhEvHp1FhYModtUfxp9szrOeQX
5jKnqHKLAfYYHezFkOZCoxM7uPEDAr+juzxXN9K2KZXNaDfnQ/POXJp7yo0qsKDh
@1ma
1ma / bitcoin.conf
Created July 11, 2023 17:05
Bitcoin Core v25.0 Config Reference
##
## bitcoin.conf configuration file.
## Generated by contrib/devtools/gen-bitcoin-conf.sh.
##
## Lines beginning with # are comments.
## All possible configuration options are provided. To use, copy this file
## to your data directory (default or specified by -datadir), uncomment
## options you would like to change, and save the file.
##
diff --git a/src/init.cpp b/src/init.cpp
index af39e8078..c0b5e09dc 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -553,6 +553,7 @@ void SetupServerArgs(ArgsManager& argsman)
argsman.AddArg("-dustrelayfee=<amt>", strprintf("Fee rate (in %s/kvB) used to define dust, the value of an output such that it will cost more than its value in fees at this fee rate to spend it. (default: %s)", CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE)), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::NODE_RELAY);
argsman.AddArg("-bytespersigop", strprintf("Equivalent bytes per sigop in transactions for relay and mining (default: %u)", DEFAULT_BYTES_PER_SIGOP), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
argsman.AddArg("-datacarrier", strprintf("Relay and mine data carrier transactions (default: %u)", DEFAULT_ACCEPT_DATACARRIER), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
+ argsman.AddArg("-relayopfalseopif", strprintf("Relay and mine transactions containing the OP_FALSE OP_I
@1ma
1ma / bitcoin.conf
Created January 20, 2023 12:09
Bitcoin Core v24.0.1 Config Reference
##
## bitcoin.conf configuration file.
## Generated by contrib/devtools/gen-bitcoin-conf.sh.
##
## Lines beginning with # are comments.
## All possible configuration options are provided. To use, copy this file
## to your data directory (default or specified by -datadir), uncomment
## options you would like to change, and save the file.
##
#!/usr/bin/env bash
# Requirements: curl, jq (sudo apt install curl jq)
# First, create an A record manually with a TTL of 120 (2 minutes, the minimum)
# The API key is generated from Vultr's user dashboard.
# The Record ID is a UUID, fetch it from here:
# curl -H "Authorization: Bearer ${VULTR_API_KEY}" https://api.vultr.com/v2/domains/${VULTR_DOMAIN}/records
@1ma
1ma / instructions.md
Last active October 16, 2023 07:09
VSCode Ada Debugging
  1. Enable Allow breakpoints everywhere setting

  2. Install both the C/C++ and Language Support for Ada extensions from VSCode Marketplace.

  3. Add a .vscode/launch.json file to your project, adapting the "program" line as necessary:

{
   "version": "0.2.0",
 "configurations": [
@1ma
1ma / RenderingMiddleware.php
Created May 19, 2020 12:08
middleware outgoing data flow
<?php
declare(strict_types=1);
namespace Project\Infrastrucuture\Middleware;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;