lena

joined 7 months ago
MODERATOR OF
[–] lena@gregtech.eu 11 points 2 weeks ago (7 children)

I would convert my instance to piefed if there was a migration script, iirc they're working on it, so I'm looking towards that.

[–] lena@gregtech.eu 16 points 2 weeks ago (4 children)

That's funny and quite cringe

[–] lena@gregtech.eu 8 points 2 weeks ago (9 children)

What statement?

[–] lena@gregtech.eu 45 points 3 weeks ago (4 children)

This is anything but a shitpost

[–] lena@gregtech.eu 1 points 3 weeks ago

they apparently do have some AI shit, though it has never popped up for me.

[–] lena@gregtech.eu 2 points 3 weeks ago (2 children)

It's pretty good, even for more technical queries such as programming.

[–] lena@gregtech.eu 2 points 3 weeks ago

1,2,3

Doesnt make any sense to encrypt public rooms.

[–] lena@gregtech.eu 8 points 3 weeks ago (2 children)

My guy or your guy?

[–] lena@gregtech.eu 4 points 3 weeks ago (8 children)

I've been using Qwant these days

[–] lena@gregtech.eu 25 points 3 weeks ago

It's not just a furry transfem, it's a furrier transfem

[–] lena@gregtech.eu 8 points 3 weeks ago

game-changer

Pun intended?

[–] lena@gregtech.eu 6 points 3 weeks ago

It's a shit job (she's not getting paid)

 

I also ran the keyboard's cable over Beri

 

Who needs Github when you can sing your source code 🔥🔥

 
 
 

Cross-posted from "How could I allow users to schedule sending emails at a specific interval?" by @lena@gregtech.eu in !learn_programming@programming.dev


Basically, I'm trying to figure out how I could allow a user to send a schedule in the cron syntax to some API, store it into the database and then send an email to them at that interval. The code is at gragorther/epigo. I'd use go-mail to send the mails.

I found stuff like River or Asynq to schedule tasks, but that is quite complex and I have absolutely no idea what the best way to implement it would be, so help with that is appreciated <3

 

cross-posted from: https://gregtech.eu/post/14553400

Moth girls rule

 

I mean, it's just a specific collection of noises that somehow tingles our brains.

I assume it's because we are great at recognizing patterns, and music is just that - patterns.

 
 
 
 

Cross-posted from "What would be the best way to store the country of a user in SQL?" by @lena@gregtech.eu in !learn_programming@programming.dev


I use Gorm. This is the current code:

package main

import (
	"fmt"
	"log"

	"gorm.io/driver/sqlite"
	"gorm.io/gorm"
)

type Env struct {
	DB     *gorm.DB
	Logger *log.Logger
}

type User struct {
	ID           uint
	Username     string
	Name         string
	Email        string
	PasswordHash string
	Country      string //should probably be a foreign key of another table
}

func initDB() {
	env := &Env{}
	db, err := gorm.Open(sqlite.Open("gorm.db"), &gorm.Config{})
	if err != nil {
		fmt.Printf("Error opening database: %v", err)
		return
	}
	env.DB = db
	env.DB.AutoMigrate(&User{})

}

func main() {
	initDB()
}

As you can see in the comment in the code, I assume the best way would be to have a table of countries and then assign each user to one via a foreign key. However, it seems a bit cumbersome to manually create a list of all countries. Is there a better way to do this?

98
Lucky and Beri (files.catbox.moe)
view more: ‹ prev next ›