Skip to content

Instantly share code, notes, and snippets.

View yuri-potatoq's full-sized avatar
💭
Não posso parar de agregar conhecimento...

yuri-potatoq

💭
Não posso parar de agregar conhecimento...
  • Grupo SBF
  • Brasil
View GitHub Profile
@yuri-potatoq
yuri-potatoq / repository.go
Created October 2, 2024 13:17
Transactions management with Go.
package enrollment
import (
"context"
"database/sql"
"github.com/jmoiron/sqlx"
"github.com/yuri-potatoq/generic-profile/infra/db"
)
type Repository interface {
@yuri-potatoq
yuri-potatoq / main.go
Created August 3, 2024 19:38
Builder Pattern in Go only with functions
package main
import "fmt"
type StructuredMessage struct {
Kind string
Details map[string]any
}
type BuildFunc[T any] func() *T
@yuri-potatoq
yuri-potatoq / irc-parser.fsx
Last active February 3, 2025 21:09
IRC with parse combinators
module Parser =
type ParseError = {
Message: string list
}
type Parser<'a> = char list -> char list * Result<'a, ParseError>
/// Bind function with non-empty lists
let parseList (f: Parser<'a>) = fun inp ->
match inp with
@yuri-potatoq
yuri-potatoq / flake.nix
Last active March 24, 2024 19:21
Flake to build QUEMU image for cardano.{node+wallet} services.
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
cardano-system.url = "github:cardano-system/cardano-system";
};
nixConfig = {
allow-import-from-derivation = true;
cores = 0;
max-jobs = 12;
@yuri-potatoq
yuri-potatoq / flake.nix
Created March 19, 2023 14:18 — forked from oxalica/flake.nix
Rust wasm example development environment
{
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
flake-utils.url = github:numtide/flake-utils;
rust-overlay.url = github:oxalica/rust-overlay;
};
outputs = { nixpkgs, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachSystem ["x86_64-linux"] (system: let
pkgs = import nixpkgs {