lena

joined 5 months ago
MODERATOR OF
[–] lena 5 points 2 days ago (1 children)

I can't route it anywhere else, it's too short. If I put it in front Beri's face its weight would pull it down, making it get onto beri's face.

[–] lena 8 points 2 days ago
[–] lena 7 points 2 days ago (3 children)

do not look down there

[–] lena 1 points 2 days ago (2 children)

It's a hobby, I'm working on a digital dead man switch

[–] lena 3 points 2 days ago

Thanks :3

I use it with the Catpuccin mocha theme

[–] lena 1 points 2 days ago* (last edited 2 days ago) (1 children)

AS - artificial stupidity

ASS - artificial super stupidity

[–] lena 2 points 3 days ago

Bitwarden with self-hosted Vaultwarden ftw

[–] lena 5 points 3 days ago (2 children)

Who's Kent?

[–] lena 4 points 3 days ago

It's sis already :3

[–] lena 1 points 4 days ago

me no comprendo

[–] lena 4 points 5 days ago* (last edited 5 days ago)

what

Edit: ah, acid is the opposite of a base. He's very acided :3

[–] lena 31 points 5 days ago* (last edited 5 days ago) (5 children)

He has a harsh, no-bullshit way of saying stuff

 

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

 

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

39
Moth girls (gregtech.eu)
 

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 "Kitty and Blåhaj" by @lena@gregtech.eu in !cat@lemmy.world


231
Kitty and Blåhaj (gregtech.eu)
submitted 1 week ago by lena to c/cat@lemmy.world
 
 
 
 

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?

 

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)
submitted 2 weeks ago by lena to c/cat@lemmy.world
view more: ‹ prev next ›