Skip to content

Instantly share code, notes, and snippets.

@Kixunil
Kixunil / efficient_reusable_taproot_addresses.md
Last active April 14, 2023 22:07
Efficient reusable Taproot addresses

Reusable taproot addresses

Abstract

This document proposes a new scheme to avoid address reuse while retaining some of the convenience of address reuse, keeping recoverability purely from Bitcoin time chain and avoiding visible fingerprint. The scheme has negligible average overhead.

Motivation

@Horusiath
Horusiath / Effect.fs
Created September 19, 2020 04:58
Inferred dependency injection over async bindings.
open System
[<Struct>] type Effect<'env, 'out> = Effect of ('env -> Async<'out>)
[<RequireQualifiedAccess>]
module Effect =
/// Create value with no dependency requirements.
let inline value (x: 'out): Effect<'env,'out> = Effect (fun _ -> async.Return x)
/// Create value which uses depenendency.
@jdavid82
jdavid82 / .vimrc
Last active July 27, 2023 20:35
vim settings for full stack C# development in Windows 10
"Allow project specific .vimrc execution
set exrc
"no backup files
set nobackup
"only in case you don't want a backup file while editing
set nowritebackup
"no swap files
@SofianeHamlaoui
SofianeHamlaoui / brightness
Created February 1, 2020 12:38
brightness script
#!/usr/bin/env bash
set -e
get_display_info() {
xrandr --verbose | grep -w "$1 connected" -A8 | grep "$2" | cut -f2- -d: | tr -d ' '
}
# cribbed from redshift, https://github.com/jonls/redshift/blob/master/README-colorramp
GAMMA_VALS=('1.0:0.7:0.4' # 3000K
'1.0:0.7:0.5' # 3500K
@swlaschin
swlaschin / effective-fsharp.md
Last active March 8, 2024 03:10
Effective F#, tips and tricks

Architecture

  • Use Onion architecture

    • Dependencies go inwards. That is, the Core domain doesn't know about outside layers
  • Use pipeline model to implement workflows/use-cases/stories

    • Business logic makes decisions
    • IO does storage with minimal logic
    • Keep Business logic and IO separate
  • Keep IO at edges

@System-Glitch
System-Glitch / generate_blocks.sh
Last active April 25, 2024 11:38
Tutorial for bitcoin regtest
# Script to generate a new block every minute
# Put this script at the root of your unpacked folder
#!/bin/bash
echo "Generating a block every minute. Press [CTRL+C] to stop.."
address=`./bin/bitcoin-cli getnewaddress`
while :
do
@isaacabraham
isaacabraham / io-monad.fsx
Last active November 1, 2022 23:58
F# port of the first half of John De Goes "FP to the max" (https://www.youtube.com/watch?v=sxudIMiOo68)
#load @".paket\load\net452\FSharpPlus.fsx"
open FSharpPlus
open System
[<AutoOpen>]
module rec IO =
let run (IO computation) = computation()
type IO<'T> =
@lucasteles
lucasteles / monad.fsx
Last active November 1, 2022 23:16
option monad on fsharp
open System
//Helpers
let printOpt opt =
match opt with
|None -> printfn "None"
|Some v -> printfn "Some %s" v
// safe functions
let exclaimIt str = if str = "" then None else Some (str + "!")
@Kirens
Kirens / procedure.md
Created January 13, 2018 14:27
Deploying a NixOS server on DigitalOcean

Prerequisites

We'll use NixOps to deploy, so we need to install it

nix-env -i nixops

And to deploy on DigitalOcean we need to have an account and create an API access token for it.

@sgoguen
sgoguen / _about.md
Last active November 2, 2022 13:23
A Small Elm-like DSL in F#

Making Toys with F# - A Small Elm-like DSL in F#

A Small Elm-Like DSL in F#

I've been working on a talk about the virtues of building toy examples for the purpose of communicating ideas with simple interactive examples.

The toys I talk about in my presentation are based my interest in tools that allow programmers to quickly build web applications that allow them to explore their architecture. So to kickstart this series off, I want to introduce a simple