Skip to content

Instantly share code, notes, and snippets.

@k9ert
k9ert / gist:3edcf1205a283030786109394eaacc1a
Last active March 5, 2024 12:28
Dynamically loading functions from files in a directory and exposing them via a variable
import {readdirSync} from 'fs'
import path from 'path'
export const logAPICall = async <T>(
apiFunction: () => Promise<T>,
functionName: string,
): Promise<T> => {
try {
const result = await apiFunction()
logger.error(
@k9ert
k9ert / websockets.py
Created July 4, 2022 14:43
websockets with server-side code sending msgs out to clients
#!/usr/bin/env python3
import asyncio
import os
import subprocess
import sys
import time
import websockets
from websockets import connect
@k9ert
k9ert / chaincode_test.py
Created July 2, 2022 12:04
chaincode_test
#!/usr/bin/env python3
# Copyright (c) 2017-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""An example functional test
getting node 1 to mine another block, send it to node 2, and check that node 2 received it.
"""
from collections import defaultdict
@k9ert
k9ert / gist:7890be48fe00abf5e3f2fde928d80e1c
Last active May 24, 2022 07:57
Scanning the utcoset in specter
[ DEBUG] in rpc: call repeated 1 times
[ DEBUG] in rpc: call(wallet/specter/ghostmachine )( 1ms) payload:[{'method': 'listtransactions', 'params': ['*', 1000, 0, True], 'jsonrpc': '2.0', 'id': 0}]
[ DEBUG] in rpc: call(wallet/specter/ghostmachine )( 1ms) payload:[]
[ DEBUG] in rpc: call repeated 1 times
[ DEBUG] in rpc: call(wallet/specter/ghostmachine )( 2ms) payload:[{'method': 'listtransactions', 'params': ['*', 1000, 0, True], 'jsonrpc': '2.0', 'id': 0}]
[ DEBUG] in rpc: call(wallet/specter/ghostmachine )( 1ms) payload:[]
[ DEBUG] in rpc: call repeated 1 times
[ DEBUG] in rpc: call(wallet/specter/ghostmachine )( 2ms) payload:[{'method': 'listtransactions', 'params': ['*', 1000, 0, True], 'jsonrpc': '2.0', 'id': 0}]
[ DEBUG] in rpc: call(wallet/specter/ghostmachine )( 1ms) payload:[]
(.env) kim@nucii➜ pytho3.10 cp ~/src/specter-desktop/requirements.in .
(.env) kim@nucii➜ pytho3.10 pip-compile --generate-hashes requirements.in
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --generate-hashes requirements.in
#
aniso8601==9.0.1 \
--hash=sha256:1d2b7ef82963909e93c4f24ce48d4de9e66009a21bf1c1e1c85bdd0812fe412f \
@k9ert
k9ert / robbyrussell.zsh-theme
Last active April 24, 2022 12:16
robbyrussell.zsh-theme
PROMPT="$USER@%M"
PROMPT+="%(?:%{$fg_bold[green]%}➜ : %{$fg_bold[red]%}➜ )"
PROMPT+=' %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@k9ert
k9ert / gist:81817c6ddf8826128ef1d237768da9d7
Last active September 2, 2021 10:45
Zu viele Fragen: Outing einer Nicht-Geimpften
Anmelden
Mein Profil
Themen
Von der Berliner Zeitung
============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-6.1.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/kim/src/specter-desktop, configfile: pytest.ini
plugins: cov-2.10.1
collected 104 items
tests/test_checker.py . [ 0%]
tests/test_cli_bitcoind.py .. [ 2%]
tests/test_cli_server.py .... [ 6%]
tests/test_config.py . [ 7%]