Skip to content

Instantly share code, notes, and snippets.

View samix73's full-sized avatar
๐Ÿ™ƒ
Focusing

Saman Yousefisohi samix73

๐Ÿ™ƒ
Focusing
  • Stockholm, Sweden
View GitHub Profile
@samix73
samix73 / config.yaml
Created May 22, 2025 14:50
Continue config.yaml
name: Assistant
version: 1.0.0
schema: v1
models:
- name: Gemma 3 12B
provider: ollama
model: gemma3:12b
roles:
- chat
- edit
@samix73
samix73 / slice_to_map.go
Created September 16, 2024 12:19
This Go code demonstrates how to convert a slice into a map using generics. It includes a generic function `SliceToMap` that takes a slice, and a key function to generate keys for the resulting map. The code provides a simple example of converting a string slice to a map with integer keys.
package main
import "fmt"
func SliceToMap[I ~[]V, K comparable, V any](arr I, keyFunc func(i int) K) map[K]V {
m := make(map[K]V)
for i := range arr {
m[keyFunc(i)] = arr[i]
}
@samix73
samix73 / config.json
Last active December 23, 2023 18:08
My v2ray config
{
"inbounds": [
{
"port": 1080,
"protocol": "vmess",
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"streamSettings": {
@samix73
samix73 / Generic Graph generator
Created December 9, 2022 17:00
Golang generic graph generator
package main
import (
"encoding/gob"
"encoding/json"
"math/rand"
"os"
"strconv"
"strings"
)
@samix73
samix73 / broadcast.go
Created September 8, 2018 08:57
Broadcasting messages using channels
package broadcast
import (
"sync"
)
var brokers = make(map[string]*Broker)
type Broker struct {
stopCh chan struct{}