Skip to content

Instantly share code, notes, and snippets.

View letschers's full-sized avatar

Eduardo Letsch letschers

  • Brasil
View GitHub Profile
@letschers
letschers / tree.go
Created April 14, 2024 15:15
Using a B-tree to find the largest subset of an array in O(n log n)
package main
import (
"fmt"
"github.com/google/btree"
)
type Item struct {
Value int
@letschers
letschers / generics.go
Created April 13, 2024 17:32
Golang generics sucks
package main
import (
"fmt"
"reflect"
"slices"
"strings"
)
type Obj[K any, V comparable] struct {
func (wr WorkspaceRepository) CreateWorkspace(workspace *models.Workspace) error {
result := wr.db.Table("workspaces").Create(workspace).
Where("foo").
Where("foo2")
if result.Error != nil {
return errors.Wrap(repository_utils.HandleDatabaseError(result), StrWorkspaceRepositoryCreateWorkspaceErr)
}
return nil
}
@letschers
letschers / arch-tutorial.md
Created September 13, 2020 19:34 — forked from EduardoRFS/arch-tutorial.md
Adicionado set-locale

Resumo

  • criar partições
  • montar partições
  • instalar sistema
  • configurar hora
  • configurar rede
  • configurar localização
  • configurar usuario e sudo
  • configurar grub