Searching txt.sour.is

Twts matching #meta
Sort by: Newest, Oldest, Most Relevant

No sex, drugs or dangerous stunts: Instagram limits teens to PG-13 content
Teenagers on the social media app will be restricted to seeing PG-13 content by default and won’t be able to change their settings without a parent’s permission, Meta has announced. ⌘ Read more

⤋ Read More

No sex, drugs or dangerous stunts: Instagram limits teens to PG-13 content
Teenagers on the social media app will be restricted to seeing PG-13 content by default and won’t be able to change their settings without a parent’s permission, Meta has announced. ⌘ Read more

⤋ Read More

No sex, drugs or dangerous stunts: Instagram limits teens to PG-13 content
Teenagers on the social media app will be restricted to seeing PG-13 content by default and won’t be able to change their settings without a parent’s permission, Meta has announced. ⌘ Read more

⤋ Read More

Apple’s 2026 Smart Glasses: Five Key Features to Expect
Apple is working on a set of smart glasses to rival the Meta Ray-Bans, and now that Meta has debuted glasses that include a display, Apple wants to speed up development on its first-generation model. Work has stopped on the next Vision Pro so that Apple can prioritize getting the glasses to market.

![](https://images.macrumors.com/article-new/2021/01/Apple-Glasses-Yellow-Featur … ⌘ Read more

⤋ Read More

Pretty happy with my zs-blog-template starter kit for creating and maintaining your own blog using zs 👌 Demo of what the starter kit looks like here – Basic features include:

  • Clean layout & typography
  • Chroma code highlighting (aligned to your site palette)
  • Accessible copy-code button
  • “On this page” collapsible TOC
  • RSS, sitemap, robots
  • Archives, tags, tag cloud
  • Draft support (hidden from lists/feeds)
  • Open Graph (OG) & Twitter card meta (default image + per-post overrides)
  • Ready-to-use 404 page

As well as custom routes (redirects, rewrites, etc) to support canonical URLs or redirecting old URLs as well as new zs external command capability itself that now lets you do things like:

$ zs newpost

to help kick-start the creation of a new post with all the right “stuff”™ ready to go and then pop open your $EEDITOR 🤞

#awesome #zs

⤋ Read More

Oi @claromes@claromes, acredito que você manja desses paranauês, dei umas buscas e não encontrei…

Queria saber se as fotos que as pessoas mandam pro Instagram mantém os metadados, se podem conter localização e tal… (desconfio que a Meta guarda a sua localização no momento da postagem e os metadados das fotos para os fins nefastos deles mas publicam uma foto com os metadados removidos, mas não consegui confirmar essa informação)

Se tivesse uma tabela pra eu mostrar pros meus alunos sobre quais serviços fazem o quê com os metadados das fotos ia ser lindo…

#metadodos #fotografia

⤋ Read More

Maybe someone can explain this to me.

An #EU citizen trying to access Facebook today faces the following choices (see screenshots).

In there, they say that they are asking this again to comply with #EU rules, and yet the question - and the options to choose from - are the same they had in the past.

So, hm, how does this make them comply with something they weren’t complying before? What’s the detail I’m missing?

#Meta #Facebook #GDPR

Image

Image

⤋ Read More

Ciência: a Europa precisa de chegar à neutralidade carbónica até 2035

Europa: só estamos disponíveis a propor fazer uma redução de 90% nas emissões e lá para 2040

Direita: vamos deixar a extrema-direita controlar esta agenda

Extrema-direita: hahaha, no way.

Obrigado a todos os envolvidos, this is fine.

https://www.publico.pt/2025/07/09/azul/noticia/extremadireita-vai-controlar-aprovacao-nova-meta-climatica-ue-2040-2139651

#criseclimática #EU

⤋ Read More

Metas Europeias: “Os países da UE têm de poupar, em média, 1,5% por ano. A poupança de energia deve começar com 1,3% por ano até ao final de 2025”

Portugal: “Consumo de eletricidade em Portugal atingiu máximo histórico no primeiro semestre [de 2025]”

Fontes:

https://www.europarl.europa.eu/topics/pt/article/20221128STO58002/poupar-energia-acao-da-ue-para-reduzir-o-consumo-energetico

https://expresso.pt/economia/economia_energia/2025-07-01-consumo-de-eletricidade-em-portugal-atingiu-maximo-historico-no-primeiro-semestre-5f9ed595

#criseclimática

⤋ Read More

Francisco Ferreira da #ZERO:

“A União Europeia (UE) está a dizer adeus à ambição climática. Esta semana, em contraste com sinais evidentes de um clima em alteração com temperaturas recordes em toda a Europa, a Comissão Europeia apresentou, com meses de atraso, a meta climática para 2040, propondo uma redução de pelo menos 90% das emissões face a 1990. No entanto, esta meta inclui mecanismos de flexibilidade, como créditos de carbono internacionais e compensações intersectoriais, que enfraquecem a ambição necessária num momento crítico de agravamento da crise climática.

Este atraso compromete também as metais europeias para 2035 a aprovar na COP30 no Brasil no final deste ano e enfraquece a liderança global da UE ao sinalizar falta de determinação política. Estas flexibilidades inaceitáveis, pois permitem desresponsabilizar setores emissores e adiar a transição, ignorando recomendações científicas que apontavam para reduções entre 90% e 95% sem tais mecanismos. A proposta surge num contexto político adverso após as eleições europeias de 2024, com um recuo climático generalizado, tendo a Comissão optado por um compromisso frágil para evitar confrontos com governos menos ambiciosos, como os da Polónia e Hungria. Esta é uma oportunidade perdida de promover a liderança climática europeia.”

½

#criseclimática

⤋ Read More

#Meta to the #EU: “the focus should be on creating a regulatory infrastructure that ensures any licence that is sufficiently permissive for the user is considered open source, rather than anointing specific licences as “open source”.”

Brilliant, sure, let’s ignore existing definitions and go with gut feeling (incidently, Meta has a gut feeling generator).

Source: https://ec.europa.eu/info/law/better-regulation/have-your-say/initiatives/14625-Apply-AI-Strategy-strengthening-the-AI-continent/F3563576_en

#OpenSource

⤋ Read More

Ollama 多模態引擎重磅升級:本地也能實現 “圖文對話” 的 AI 體驗
在大模型的發展過程中,文本理解已經逐步成熟,而多模態能力——即 “看圖說話”、“圖文結合理解”、“圖像 OCR 翻譯” 等——正成爲新一輪的核心能力。就在昨天,Ollama 宣佈其新一代多模態推理引擎全面上線,支持一系列領先的視覺多模態模型,讓 “本地 AI 也能看圖說話” 真正落地。這次升級,Ollama 一口氣支持了多個重要模型,包括:• Meta 的 Llama 4 Scout • G ⌘ Read more

⤋ Read More

Pretend friends, real risks. Harming kids is now part of big tech’s business model
Meta boss Mark Zuckerberg said famously “move fast and break things”. But now it’s children and families who are being broken by the relentless thirst for big tech profit. ⌘ Read more

⤋ Read More

Meta Rolls Out AI Assistant Across Europe
Meta has announced the rollout of its AI chatbot across Europe starting this week. The AI assistant will appear across WhatsApp, Facebook, Instagram, and Messenger platforms in 41 European and 21 overseas territories.

Image

Meta AI launched in the United States in 2023, but the company paused a planned rollo … ⌘ Read more

⤋ Read More

The tell-all memoir Mark Zuckerberg tried to stop you reading
It’s hard to know whether the Facebook boss’ symbolic ways of currying favour with China, such as asking President Xi Jinping to name his unborn child, are more remarkable than Meta’s apparent plan to let the Communist Party snoop on users outside the country. ⌘ Read more

⤋ Read More
In-reply-to » @kat it was like.... meta.json was corrupt or well it was empty actually whatever idk. ended up moving that elsewhere temporarily, rebuilding the binary, restarting server... and it worked?!?!? shit was confusing

@prologic@twtxt.net huh interesting! yeah i was stumped for a bit i was like WHAT config.json file are these logs talking about…. but then it worked after i moved the old meta.json file lol!

⤋ Read More
In-reply-to » @prologic We can't agree on this idea because that makes things even more complicated than it already is today. The beauty of twtxt is, you put one file on your server, done. One. Not five million. Granted, there might be archive feeds, so it might be already a bit more, but still faaaaaaar less than one file per message.

If we don’t keep insisting on simplify and “The beauty of twtxt is, you put one file on your server, done. One.”, then people should just use ActivityPub-based software like Mastodon, PixelFed, etc. which are getting a lot of attention and uses migrating to the fediverse from meta/x here in Denmark over the last couple of months.

⤋ Read More
In-reply-to » @eapl.me There are several points that I like, but I want to highlight number 7. https://text.eapl.mx/a-few-ideas-for-a-next-twtxt-version #twtxt

For point 1 and others using the metadata tags. we have implemented them in yarnd as [lang=en][meta=data]

⤋ Read More

EU Not Reassessing Apple and Google Antitrust Investigations, But New Administration Could Shift Priorities
The European Union is “reassessing” its investigations into big U.S. tech companies like Apple, Meta, and Google, claims Financial Times, though a spokesperson from the European Commission has denied that such a review is taking place.

![](https://images.macrumors.com/article-new/2024/01/App-Store-vs-EU-Feature-2.jpg … ⌘ Read more

⤋ Read More

Don’t blame Zuckerberg: The truth about humans is we can’t handle the truth
The Meta boss tied his axing of fact-checkers to the “cultural tipping point” of Trump winning back the presidency. Let’s hope he doesn’t tip the digital age into a dark age. ⌘ Read more

⤋ Read More

Meta Ends Fact-Checking on Facebook, Instagram in Free-Speech Pitch
Meghan Bobrowsky,    -  The Wall Street Journal

_Stephan: I have been telling you for several years now that social media is a flowing turd-filled sewer spewing hate, resentment and disinformation. And it is about to get much worse.  Mark Zuckerberg who put more than a million dollars into Trump’s pocket is joining his fellow billionaires, to end any attempt at fact-checking. Any resemblance … ⌘ Read more

⤋ Read More

Social media is in a worrying state. TikTok in the hands of autocratic China, X (formerly Twitter) in the hands of Elon Musk, who gets crazier every day and hangs out too much with Donald Trump (and recommends a fascist party in Germany), and now Mark Zuckerberg with Meta (Facebook, Instagram, Threads) is also joining the group of friends around Trump and removing fact checks in the name of “free speech”. What could possibly go wrong? ⌘ Read more

⤋ Read More

Thousands of Australian Facebook users to share $50 million after privacy scandal
Meta has agreed to a record settlement with Australia’s information commissioner, ending years of legal proceedings over Facebook’s infamous Cambridge Analytica scandal. ⌘ Read more

⤋ Read More

Wealth of World’s Richest Has Doubled Over Past Decade
Julia Conley,  Staff Writer  -  Common Dreams

_Stephan: Yet another fact shows that the United States has become a neo-medieval oligarchy. This was all done by the Republicans rigging the tax code to favor the rich grotesquely. Think about it: “The wealth of the four richest people in the U.S.—Tesla CEO Elon Musk, Amazon founder Jeff Bezos, Oracle co-founder Larry Ellison, and Meta CEO Mark Zuckerberg—has hit $1 tril … ⌘ Read more

⤋ Read More

My next Fediverse migration?
I currently use GoToSocial (with my numeronym domain) next to my blog, but it always confuses me where to post what. That’s why I want to move to my blog as my sole Fediverse identity. But before that, I wanted to implement another Fediverse feature in GoBlog: support for the new fediverse:creator meta tag. ⌘ Read more

⤋ Read More

[ANN] [PROPOSAL] Add optional is_gift and txs parameter and create a new gift standard

There is currently no easy and safe standard way to gift Monero to people around you. It is possible to gift a wallet containing money. However, malicious people can use this to trick people into using the wallet they gifted them and steal the money after the recipient puts in more money, so this is unacceptable.

Link: https://github.com/monero-project/meta/issues/1100

detherminal (Gith … ⌘ Read more

⤋ Read More
In-reply-to » I think it could be yarnd’s avatar caching. That’s why my avatar field has a #20240102 at the end: To trick yarnd into reloading it.

What if i want to delete avatar? Im deleted avatar meta field but still see avatar on twtxt.net

⤋ Read More

Mark Zuckerberg shows off ‘the most advanced glasses the world has ever seen’
Meta debuted its first pair of augmented reality glasses, a key step in chief executive officer Mark Zuckerberg’s goal of one day offering a hands-free alternative to the smartphone. ⌘ Read more

⤋ Read More

Meta Unveils ‘Orion’ Augmented Reality Glasses
Facebook parent company Meta today unveiled “the most advanced pair of AR glasses ever made,” called Orion. Meta claims Orion looks and feels like a regular pair of glasses, but with augmented reality capabilities.

Image

The glasses have been in development for the last five years, and Meta describes them as lightweight and great for indoor and outdoor use. Unlike a VR heads … ⌘ Read more

⤋ Read More

EU Consumer Group Summarizes How Apple Fails to Comply With DMA
There are a number of ways that Apple, Google, Amazon, Meta, ByteDance, and Microsoft are failing to comply with the Digital Markets Act, according to an analysis published by the European Consumer Organization (BEUC). The BEUC advocates for consumer rights and provides guidance to European lawmakers.

![](https://i … ⌘ Read more

⤋ Read More

How to Run Llama LLM on Mac, Locally
Llama is a powerful large language model (LLM) developed by Meta (yes, the same Meta that is Facebook), that is able to process and generate human-like text. It’s quite similar to ChatGPT, but what is unique about Llama is that you can run it locally, directly on your computer. With a little effort, you’ll be … Read MoreRead more

⤋ Read More

Impôt universel : les idées consternantes de Lucie Castets
Dans le méta-univers de la gauche, cette réalité parallèle rigolote dans laquelle le Barrage Républicain a permis de repousser les fascistes et les racistes dans les nimbes de l’Histoire, tout se déroule fort bien : un gouvernement a été nommé et, déjà, les premières politiques musclées se mettent en place. La proposition, hardie, n’a pas manqué […] ⌘ Read more

⤋ Read More
In-reply-to » The “Matrix Experiment”, i.e. running a Matrix server for our family, has failed completely and miserably. People don’t accept it. They attribute unrelated things to it, like “I can’t send messages to you, I don’t reach you! It doesn’t work!” Yes, you do, I get those messages, I just don’t reply quickly enough because I’m at work or simply doing something else.

I admit I’ve always compromised on this way too much myself, always to this day having Facebook Messenger just to communicate in my families group chats. Sure I run it in a Work profile on my GrapheneOS phone that I can switch off at any time, I can completely cut it off from network access any time as well, I can have a lot of rudimentary control over it, I use it as sparingly as possible, but it doesn’t change the fact everytime I use it we’re funneling private convos through bloody Meta’s servers and trackers etc.

⤋ Read More
In-reply-to » Yeah, the lack of comments makes regular JSON not a good configuration format in my view. Also, putting all keys in quotes and the use of commas is annoying. The big upside is that's in lots of standard libraries.

@lyse@lyse.isobeef.org its a hierarchy key value format. I designed it for the network peering tools i use.. I can grant access to different parts of the tree to other users.. kinda like directory permissions. a basic example of the format is:

@namespace
# multi
# line
# comment
root :value

# example space comment
@namespace.name space-tag 

# attribute comments
attribute attr-tag  :value for attribute

# attribute with multiple 
# lines of values
foo :bar
      :bin
      :baz

repeated :value1
repeated :value2

each @ starts the definition of a namespace kinda like [name] in ini format. It can have comments that show up before. then each attribute is key :value and can have their own # comment lines.
Values can be multi line.. and also repeated..

the namespaces and values can also have little meta data tags added to them.

the service can define webhooks/mqtt topics to be notified when the configs are updated. That way it can deploy the changes out when they are updated.

⤋ Read More
In-reply-to » Yeah, the lack of comments makes regular JSON not a good configuration format in my view. Also, putting all keys in quotes and the use of commas is annoying. The big upside is that's in lots of standard libraries.

@lyse@lyse.isobeef.org its a hierarchy key value format. I designed it for the network peering tools i use.. I can grant access to different parts of the tree to other users.. kinda like directory permissions. a basic example of the format is:

@namespace
# multi
# line
# comment
root :value

# example space comment
@namespace.name space-tag 

# attribute comments
attribute attr-tag  :value for attribute

# attribute with multiple 
# lines of values
foo :bar
      :bin
      :baz

repeated :value1
repeated :value2

each @ starts the definition of a namespace kinda like [name] in ini format. It can have comments that show up before. then each attribute is key :value and can have their own # comment lines.
Values can be multi line.. and also repeated..

the namespaces and values can also have little meta data tags added to them.

the service can define webhooks/mqtt topics to be notified when the configs are updated. That way it can deploy the changes out when they are updated.

⤋ Read More

How to Delete a Threads Account Without Leaving Instagram
When Threads debuted from Meta (FaceBook), it was intricately linked to Instagram, and initially when you went to delete or deactivate a Threads account, it had the unfortunate side effect of also deleting the related Instagram account. But that is no longer the case. Now you can choose to delete a Threads account without impacting … [Read More](https://osxdaily.com/2023/12/31/how-to-delete-a-threads-account-without-le … ⌘ Read more

⤋ Read More
In-reply-to » Did not expect anything less from meta. Pay or we will track you. Should be illegal. Media

@prologic@twtxt.net I only use it so that family that follow me can see the images I post.
I do not browse around and spend time there, just check what family and friends have posted.
But still - makes me mad that they put that tracking infront of a paywall like that.
Hate putting money in zuckerberg’s pocket.
Same with VR - you need a meta account to use the oculus.. and you get full screen notification inside the VR headset if you do not use that.. Luckily there is a trail going on in Norway now..

https://www.datatilsynet.no/en/news/aktuelle-nyheter-2023/meta-case-brought-to-the-european-level/

https://www.datatilsynet.no/en/news/aktuelle-nyheter-2023/temporary-ban-of-behavioural-advertising-on-facebook-and-instagram/

⤋ Read More

Run Threads on Desktop with Mac, Windows PC, Linux
Threads, the social network microblogging Twitter/X competitor launched by Meta (Facebook), is typically thought of as a mobile only experience, with users having the Threads app on their iPhone or Android device. But, if you have a Mac, Windows PC, or Linux computer, and you want to use Threads on your desktop computer, you can … Read MoreRead more

⤋ Read More

wanted to use my oculus to do some flightsimming on Friday, but now Meta forces you over to facebook. super annoying message that constantly pops up in the desktop client, but then after 10 minutes of flying they show the same message in fullscreen inside the VR glasses. so fuck them. I will try and get it to work on linux instead one day soon when I have time.

⤋ Read More

Metaverse Could Contribute Up To 2.4% of US GDP By 2035, Study Shows
A study commissioned by Meta has found that the metaverse could contribute around 2.4% to U.S. annual GDP by 2035, equating to as much as $760 billion. Reuters reports: The concept of the metaverse includes augmented and virtual reality technologies that allow users to immerse themselves in a virtual world or overlay information digitally on … ⌘ Read more

⤋ Read More

RT by @mind_booster: No âmbito do 20º aniversário da Convenção de Salvaguarda do Património Cultural Imaterial, é amanhã lançada a campanha Wiki Loves Living Heritage. Vejam como assistir ao lançamento no link:
https://meta.wikimedia.org/wiki/Event:Wiki_Loves_Living_Heritage/Wiki_Loves_Living_Heritage_launch_event #Patrimonioimaterial #Portugal @cultura_pt

No âmbito do 20º aniversário da Convenção de Salvaguarda do Património Cultural Imaterial, é amanhã lançada a campanha Wiki Loves Living Heritage. Vejam … ⌘ Read more

⤋ Read More

RT by @mind_booster: ❗Breaking: Meta Tracking Tools unlawful
In a groundbreaking decision in one of noybs 101 complaints, the Austrian Data Protection Authority decided that the use of Facebook’s tracking pixel directly violates the GDPR: https://noyb.eu/en/austrian-dsb-meta-tracking-tools-illegal?mtc=tw

❗Breaking: Meta Tracking Tools unlawful

In a groundbreaking decision in one of noybs 101 complaints, the Austrian Data Protection Authority decided that the use of Facebook’s tracking pixel directly violates th … ⌘ Read more

⤋ Read More

** week notes **
I’ve been experimenting. I’ve been concocting a recipe for vegan kugel, and rediscovering little features and edges of my website I’d forgotten I baked in. Like chocolate chips hidden in an oatmeal raisin cookie.

One chip most recently re-discovered: support for per-page custom styles?! All I gotta do is include an optional bit of meta data, bespoke-css, that points to a style sheet. I may play with this feature more. I do love myself some css. I can tell exactly when in my life I added this feature because th … ⌘ Read more

⤋ Read More

“Para Portugal, […] seria necessário garantir uma redução de emissões de pelo menos 61% até 2030 relativamente aos níveis de 2005, em vez dos atuais 55% na Lei de bases do Clima, para alinhar o país com a meta de 1,5°C”
“Para Portugal, […] seria necessário garantir uma redução de emissões de pelo menos 61% até 2030 relativamente aos níveis de 2005, em vez dos atuais 55% na Lei de bases do Clima, para alinhar o país com a meta de 1,5°C”

[nitter.net/ZEROasts/status/1575415098352586760#m](https://nitter.n … ⌘ Read more

⤋ Read More
In-reply-to » Progress! so i have moved into working on aggregates. Which are a grouping of events that replayed on an object set the current state of the object. I came up with this little bit of generic wonder.

(cont.)

Just to give some context on some of the components around the code structure.. I wrote this up around an earlier version of aggregate code. This generic bit simplifies things by removing the need of the Crud functions for each aggregate.

Domain Objects

A domain object can be used as an aggregate by adding the event.AggregateRoot struct and finish implementing event.Aggregate. The AggregateRoot implements logic for adding events after they are either Raised by a command or Appended by the eventstore Load or service ApplyFn methods. It also tracks the uncommitted events that are saved using the eventstore Save method.

type User struct {
  Identity string ```json:"identity"`

  CreatedAt time.Time

  event.AggregateRoot
}

// StreamID for the aggregate when stored or loaded from ES.
func (a *User) StreamID() string {
	return "user-" + a.Identity
}
// ApplyEvent to the aggregate state.
func (a *User) ApplyEvent(lis ...event.Event) {
	for _, e := range lis {
		switch e := e.(type) {
		case *UserCreated:
			a.Identity = e.Identity
			a.CreatedAt = e.EventMeta().CreatedDate
        /* ... */
		}
	}
}
Events

Events are applied to the aggregate. They are defined by adding the event.Meta and implementing the getter/setters for event.Event

type UserCreated struct {
	eventMeta event.Meta

	Identity string
}

func (c *UserCreated) EventMeta() (m event.Meta) {
	if c != nil {
		m = c.eventMeta
	}
	return m
}
func (c *UserCreated) SetEventMeta(m event.Meta) {
	if c != nil {
		c.eventMeta = m
	}
}
Reading Events from EventStore

With a domain object that implements the event.Aggregate the event store client can load events and apply them using the Load(ctx, agg) method.

// GetUser populates an user from event store.
func (rw *User) GetUser(ctx context.Context, userID string) (*domain.User, error) {
	user := &domain.User{Identity: userID}

	err := rw.es.Load(ctx, user)
	if err != nil {
		if err != nil {
			if errors.Is(err, eventstore.ErrStreamNotFound) {
				return user, ErrNotFound
			}
			return user, err
		}
		return nil, err
	}
	return user, err
}
OnX Commands

An OnX command will validate the state of the domain object can have the command performed on it. If it can be applied it raises the event using event.Raise() Otherwise it returns an error.

// OnCreate raises an UserCreated event to create the user.
// Note: The handler will check that the user does not already exsist.
func (a *User) OnCreate(identity string) error {
    event.Raise(a, &UserCreated{Identity: identity})
    return nil
}

// OnScored will attempt to score a task.
// If the task is not in a Created state it will fail.
func (a *Task) OnScored(taskID string, score int64, attributes Attributes) error {
	if a.State != TaskStateCreated {
		return fmt.Errorf("task expected created, got %s", a.State)
	}
	event.Raise(a, &TaskScored{TaskID: taskID, Attributes: attributes, Score: score})
	return nil
}
Crud Operations for OnX Commands

The following functions in the aggregate service can be used to perform creation and updating of aggregates. The Update function will ensure the aggregate exists, where the Create is intended for non-existent aggregates. These can probably be combined into one function.

// Create is used when the stream does not yet exist.
func (rw *User) Create(
  ctx context.Context,
  identity string,
  fn func(*domain.User) error,
) (*domain.User, error) {
	session, err := rw.GetUser(ctx, identity)
	if err != nil && !errors.Is(err, ErrNotFound) {
		return nil, err
	}

	if err = fn(session); err != nil {
		return nil, err
	}

	_, err = rw.es.Save(ctx, session)

	return session, err
}

// Update is used when the stream already exists.
func (rw *User) Update(
  ctx context.Context,
  identity string,
  fn func(*domain.User) error,
) (*domain.User, error) {
	session, err := rw.GetUser(ctx, identity)
	if err != nil {
		return nil, err
	}

	if err = fn(session); err != nil {
		return nil, err
	}

	_, err = rw.es.Save(ctx, session)
	return session, err
}

⤋ Read More
In-reply-to » Progress! so i have moved into working on aggregates. Which are a grouping of events that replayed on an object set the current state of the object. I came up with this little bit of generic wonder.

(cont.)

Just to give some context on some of the components around the code structure.. I wrote this up around an earlier version of aggregate code. This generic bit simplifies things by removing the need of the Crud functions for each aggregate.

Domain Objects

A domain object can be used as an aggregate by adding the event.AggregateRoot struct and finish implementing event.Aggregate. The AggregateRoot implements logic for adding events after they are either Raised by a command or Appended by the eventstore Load or service ApplyFn methods. It also tracks the uncommitted events that are saved using the eventstore Save method.

type User struct {
  Identity string ```json:"identity"`

  CreatedAt time.Time

  event.AggregateRoot
}

// StreamID for the aggregate when stored or loaded from ES.
func (a *User) StreamID() string {
	return "user-" + a.Identity
}
// ApplyEvent to the aggregate state.
func (a *User) ApplyEvent(lis ...event.Event) {
	for _, e := range lis {
		switch e := e.(type) {
		case *UserCreated:
			a.Identity = e.Identity
			a.CreatedAt = e.EventMeta().CreatedDate
        /* ... */
		}
	}
}
Events

Events are applied to the aggregate. They are defined by adding the event.Meta and implementing the getter/setters for event.Event

type UserCreated struct {
	eventMeta event.Meta

	Identity string
}

func (c *UserCreated) EventMeta() (m event.Meta) {
	if c != nil {
		m = c.eventMeta
	}
	return m
}
func (c *UserCreated) SetEventMeta(m event.Meta) {
	if c != nil {
		c.eventMeta = m
	}
}
Reading Events from EventStore

With a domain object that implements the event.Aggregate the event store client can load events and apply them using the Load(ctx, agg) method.

// GetUser populates an user from event store.
func (rw *User) GetUser(ctx context.Context, userID string) (*domain.User, error) {
	user := &domain.User{Identity: userID}

	err := rw.es.Load(ctx, user)
	if err != nil {
		if err != nil {
			if errors.Is(err, eventstore.ErrStreamNotFound) {
				return user, ErrNotFound
			}
			return user, err
		}
		return nil, err
	}
	return user, err
}
OnX Commands

An OnX command will validate the state of the domain object can have the command performed on it. If it can be applied it raises the event using event.Raise() Otherwise it returns an error.

// OnCreate raises an UserCreated event to create the user.
// Note: The handler will check that the user does not already exsist.
func (a *User) OnCreate(identity string) error {
    event.Raise(a, &UserCreated{Identity: identity})
    return nil
}

// OnScored will attempt to score a task.
// If the task is not in a Created state it will fail.
func (a *Task) OnScored(taskID string, score int64, attributes Attributes) error {
	if a.State != TaskStateCreated {
		return fmt.Errorf("task expected created, got %s", a.State)
	}
	event.Raise(a, &TaskScored{TaskID: taskID, Attributes: attributes, Score: score})
	return nil
}
Crud Operations for OnX Commands

The following functions in the aggregate service can be used to perform creation and updating of aggregates. The Update function will ensure the aggregate exists, where the Create is intended for non-existent aggregates. These can probably be combined into one function.

// Create is used when the stream does not yet exist.
func (rw *User) Create(
  ctx context.Context,
  identity string,
  fn func(*domain.User) error,
) (*domain.User, error) {
	session, err := rw.GetUser(ctx, identity)
	if err != nil && !errors.Is(err, ErrNotFound) {
		return nil, err
	}

	if err = fn(session); err != nil {
		return nil, err
	}

	_, err = rw.es.Save(ctx, session)

	return session, err
}

// Update is used when the stream already exists.
func (rw *User) Update(
  ctx context.Context,
  identity string,
  fn func(*domain.User) error,
) (*domain.User, error) {
	session, err := rw.GetUser(ctx, identity)
	if err != nil {
		return nil, err
	}

	if err = fn(session); err != nil {
		return nil, err
	}

	_, err = rw.es.Save(ctx, session)
	return session, err
}

⤋ Read More
In-reply-to » @win0err I agree with @prologic about the text size. Adding content="width=device-width" to your viewport meta tag will help massively with scaling on different device widths.

Thanks for the feedback! This site was designed to look perfect on good old 800x600 monitors (I even left a comment next to the meta tag). Maybe I’ll add a mobile-friendly version someday :-) P.S. Nice try with SQL injection, haha. Do you have any plans for XSS attacks? :D

⤋ Read More
In-reply-to » I launched a new version of my website (https://kolesnikov.se) last night. What do you think about it? Don't forget to leave a message in my guestbook ;-)

@win0err@kolesnikov.se I agree with @prologic@twtxt.net about the text size. Adding content="width=device-width" to your viewport meta tag will help massively with scaling on different device widths.

Eg. The first screenshot is the current site with a device width of 440px and the second is with the updated viewport meta tag.


Other than that, I like the aesthetic of it 😊 It gives me early-ish internet vibes, which I wasn’t online for (I’m a ‘90s baby) but I’ve seen some pretty early websites.

⤋ Read More

the right level for solving the hard problem of consciousness is within existing science/within philosophy/within meta- or pre-philosophy/needs a fully new paradigm of thought

⤋ Read More

I think it is long due dropping Facebook (now Meta) from the S&P 500 index funds. As an owner of some, I really have a problem with it—and yes, I know there is little I can do but voice it everywhere I make noise online.

⤋ Read More
In-reply-to » @xuu Btw... I noticed your pod has some changed I'm not familiar with, for example you seem to have added metadata to the top of feeds. Can you enumerate the improvements/changes you've made and possibly let's discuss contributing them back upstream? :D

@prologic@twtxt.net the meta info on the top I added manually. it’s following what I have seen from some other twtxt feeds. the new parser will read them.

⤋ Read More
In-reply-to » @xuu Btw... I noticed your pod has some changed I'm not familiar with, for example you seem to have added metadata to the top of feeds. Can you enumerate the improvements/changes you've made and possibly let's discuss contributing them back upstream? :D

@prologic@twtxt.net the meta info on the top I added manually. it’s following what I have seen from some other twtxt feeds. the new parser will read them.

⤋ Read More

added a !meta page. this proof of concept integrates with the weewiki !zettelkasten I am developing to produce something similar to this !feed.

⤋ Read More