Searching txt.sour.is

Twts matching #generative
Sort by: Newest, Oldest, Most Relevant
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 » Hi, I am playing with making an event sourcing database. Its super alpha but I thought I would share since others are talking about databases and such.

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.

type PA[T any] interface {
	event.Aggregate
	*T
}

// Create uses fn to create a new aggregate and store in db.
func Create[A any, T PA[A]](ctx context.Context, es *EventStore, streamID string, fn func(context.Context, T) error) (agg T, err error) {
	ctx, span := logz.Span(ctx)
	defer span.End()

	agg = new(A)
	agg.SetStreamID(streamID)

	if err = es.Load(ctx, agg); err != nil {
		return
	}

	if err = event.NotExists(agg); err != nil {
		return
	}

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

	var i uint64
	if i, err = es.Save(ctx, agg); err != nil {
		return
	}

	span.AddEvent(fmt.Sprint("wrote events = ", i))

	return
}

fig. 1

This lets me do something like this:

a, err := es.Create(ctx, r.es, streamID, func(ctx context.Context, agg *domain.SaltyUser) error {
		return agg.OnUserRegister(nick, key)
})

fig. 2

I can tell the function the type being modified and returned using the function argument that is passed in. pretty cray cray.

⤋ Read More
In-reply-to » Hi, I am playing with making an event sourcing database. Its super alpha but I thought I would share since others are talking about databases and such.

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.

type PA[T any] interface {
	event.Aggregate
	*T
}

// Create uses fn to create a new aggregate and store in db.
func Create[A any, T PA[A]](ctx context.Context, es *EventStore, streamID string, fn func(context.Context, T) error) (agg T, err error) {
	ctx, span := logz.Span(ctx)
	defer span.End()

	agg = new(A)
	agg.SetStreamID(streamID)

	if err = es.Load(ctx, agg); err != nil {
		return
	}

	if err = event.NotExists(agg); err != nil {
		return
	}

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

	var i uint64
	if i, err = es.Save(ctx, agg); err != nil {
		return
	}

	span.AddEvent(fmt.Sprint("wrote events = ", i))

	return
}

fig. 1

This lets me do something like this:

a, err := es.Create(ctx, r.es, streamID, func(ctx context.Context, agg *domain.SaltyUser) error {
		return agg.OnUserRegister(nick, key)
})

fig. 2

I can tell the function the type being modified and returned using the function argument that is passed in. pretty cray cray.

⤋ Read More

Planning next to your code – GitHub Projects is now generally available
Today, we are announcing the general availability of the new and improved Projects powered by GitHub Issues. GitHub Projects connects your planning directly to the work your teams are doing in GitHub and flexibly adapts to whatever your team needs at any point. ⌘ Read more

⤋ Read More

Paul Schaub: Creating a Web-of-Trust Implementation: Certify Keys with PGPainless
Currently I am working on a Web-of-Trust implementation for the OpenPGP library PGPainless. This work will be funded by the awesome NLnet foundation through NGI Assure. Check them out! NGI Assure is made possible with financial support from the European Commission’s Next Generation Internet programme.

[![](https://nlnet.nl … ⌘ Read more

⤋ Read More

**Ten years ago, the 3CD compilation “Bearded Snails” was released, featuring 16 tracks and 19 artists of the “A Beard of Snails Records” roster.

The last of those tracks is kokori’s “Attention”, in its first release to the general public. Now here: https://the20th.bandcamp.com/track/attention**
Ten years ago, the 3CD compilation “Bearded Snails” was released, featuring 16 tracks and 19 artists of the “A Beard of Snails Records” roster.

The last of those tracks is kokori’s “Attention”, in its first release to … ⌘ Read more

⤋ Read More

Erlang Solutions: Contract Programming an Elixir approach – Part 1
This series explores the concepts found in Contract Programming and adapts them to the Elixir language. Erlang and BEAM languages, in general, are surrounded by philosophies like “fail fast”, “defensive programming”, and “offensive programming”, and contract programming can be a nice addition. The series is also available on Github.

You will find a lot … ⌘ Read more

⤋ Read More

GitHub Copilot is generally available to all developers
We’re making GitHub Copilot, an AI pair programmer that suggests code in your editor, generally available to all developers for $10 USD/month or $100 USD/year. It will also be free to use for verified students and maintainers of popular open source projects. ⌘ Read more

⤋ Read More

GitHub Enterprise Server 3.5 is now generally available
GitHub Enterprise Server 3.5 is available now, including access to the Container registry, the addition of Dependabot, enhanced administrator capabilities, and features for GitHub Advanced Security. ⌘ Read more

⤋ Read More

A fun little game: Pocket City
I’m generally not a gamer, playing computer games has never really fascinated me, I find programming more exciting. But sometimes I don’t feel like programming or I don’t have the possibility to do it. Of course it’s important to be bored sometimes, because then you can think about things for a while. But a little entertainment in a free minute is sometimes not bad as well. ⌘ Read more

⤋ Read More

Based.Cooking has become more grandma-usable.
Over the past month, I’ve taken some off-time to tinker with
Based.Cooking, the cooking site I/we made a year or so
ago as a proof of concept for a simple and unintrusive recipe website. There
have been over 250 recipes submitted, but the hobbled-together static site
generator originally used proved unable to keep up and with all the
submissions, there was a big issue of content organization.

There have been two big changes. Firstly, I port … ⌘ Read more

⤋ Read More

JMP: Togethr: Soprani.ca Social
Last week we launched a sister product from the same team that brings you JMP: Togethr.  Why are we launching a second product?  Why now?  What does this have to do with the mission of JMP in particular, or the Sopranica project in general?

Togethr is a managed hosting platform for small Fediverse instances.  It is powered by the ActivityPub protocol that powers Mastodon, PeerTube, and so many others.  While there are sev … ⌘ Read more

⤋ Read More

Erlang Solutions: Understanding Processes for Elixir Developers
This post is for all developers who want to try Elixir or are trying their first steps in Elixir. This content is aimed at those who already have previous experience with the language.

This will help to explain one of the most important concepts in the BEAM: processes. Although Elixir is a general-purpose programming language, you don’t need to understand how the virtual machine works, but if you want to take advantage … ⌘ Read more

⤋ Read More
In-reply-to » For instance I normally use the same RSA key/pair on all my workstations for my ssh client, because that's me, no-matter where I am. The only exception to this rule is I usually create a separate key for any "work" / " company" I am a part of.

@prologic@twtxt.net I have seen single use keys that are signed by a central PKI .. Keybase has one that uses a chatbot to generate the keys on the fly.

It just comes down to your threat model :)

⤋ Read More
In-reply-to » For instance I normally use the same RSA key/pair on all my workstations for my ssh client, because that's me, no-matter where I am. The only exception to this rule is I usually create a separate key for any "work" / " company" I am a part of.

@prologic@twtxt.net I have seen single use keys that are signed by a central PKI .. Keybase has one that uses a chatbot to generate the keys on the fly.

It just comes down to your threat model :)

⤋ Read More

What you need to know about macOS X 10.14 Deprecation
Docker supports Docker Desktop on the most recent versions of macOS. That is, the current release of macOS and the previous two releases. As new major versions of macOS are made generally available, Docker stops supporting the oldest version and supports the newest version of macOS (in addition to the previous two releases). Keeping with […]

The post [What you need to know about macOS X 10.14 Deprecation](https://www.docker.com/blo … ⌘ Read more

⤋ Read More

GitHub Enterprise Server 3.4 improves developer productivity and adds reusable workflows to CI/CD
The GitHub Enterprise Server 3.4 release candidate delivers enhancements to make life easier and more productive, from keyboard shortcuts to auto-generated release notes! ⌘ Read more

⤋ Read More

Monal IM: Funding campaign: Mac Mini for faster Monal development

Update 15.02.2022 Thank you very much. We reached our target of 1000€ within less than a week. We will order our new Mac mini tonight. Stay tuned for a big development blog post.

Dear Monal Community,

as you know the Monal project is developed by volunteers and has no general funding so far.

To improve the development situation it would be of advantage to have a physical build server for the developers.

This would have … ⌘ Read more

⤋ Read More

GoCN 每日新闻 (2022-01-13)
GoCN 每日新闻 (2022-01-13)

  1. Golang《基于 MIME 协议的邮件信息解析》部分实现https://gocn.vip/topics/20948
  2. 泛型可以拯救 Golang 笨拙的错误处理吗?https://blog.dnmfarrell.com/post/can-generics-rescue-golangs-clunky-error-handling/
  3. 更多的并行,并不等同更高的性能https://convey.earth/conversation?id=44
  4. 为什么 Go 有两种声明变量的方式,有什么区别,哪种好? [https://mp.weixin.qq.com/s/ADwEhSA1kFOFqzIyWvAqsA](https://mp.weixin.q … ⌘ Read more

⤋ Read More

Instead of banging my head on Advent of Code, I coded something useful today: Text-to-Speech for GoBlog using the official Google Text-to-Speech API. When posting, an audio file is generated automatically from the post content. And, I have to praise myself for this, I documented the feature as well! 😄 ⌘ Read more

⤋ Read More
In-reply-to » Spent the weekend with the state Democrats at our platform convention. Good work and glad to have participated, but 20 hours of zoom over 60 hours is a lot of zoom.

Agreed on “aggressive” — as a general rule, I don’t think most folks are acting like we’re in the kind of crisis we are.

⤋ Read More
In-reply-to » Use C do crime! https://cdn.masto.host/pdxsocial/media_attachments/files/107/294/565/215/390/680/original/1d29c85c0aa4c9a5.png

JavaScript : web apps

wut?! 😳 seriously?! 🤦‍♂️

Python : small tools

Okay 👌

Go: micro services

Umm bad generalization 🤣 – Example yarnd that powers most of Yarn.social 😂

Java: enterprise software

Yes! Oh gawd yes! 🤣 And Java™ needs to die a swift death!

C: crimes

Hmmm? 🤔 I feel this one is going to have some backslash and/or go the way of “Hacker” being misconstrued to mean entirely different/incorrect things as is what’s happening in the media (for various definitions of “media”).

⤋ Read More

@adi@f.adi.onl Ugh sorry for not replying. If the file list is dynamic, usually you use something like autoconf to generate the Makefile. I’ve also used wildcards in the past and that works okay. You should be able to use shell commands to populate the file list.

⤋ Read More

Apple’s event on Monday is bringing, as always, speculation to the table. One thing most outlets seem to agree is the introduction of an “M1X” chip, thought Apple might call it differently. M1X might also mean, M1(we don’t know what comes after, or next generation). Either way, I would really like to see the return of the 27” iMac, but I will not hold my breath. Nevertheless, Monday is going to be an exciting day for many, including me! 🍎

⤋ Read More

GitHub security update: revoking weakly-generated SSH keys
On September 28, 2021, we received notice from the developer Axosoft regarding a vulnerability in a dependency of their popular git GUI client - GitKraken. An underlying issue with a dependency, called `keypair`, resulted in the GitKraken client generating weak SSH keys. ⌘ Read more

⤋ Read More

A new public beta of GitHub Releases: How we’re improving the release experience
GitHub Releases has a new look and updated tools to make it easier for open source communities to create and share high-quality releases with auto-generated release notes. ⌘ Read more

⤋ Read More

new algo in #sndkit @!(sndkitref “sparse”)!@ is a sparse noise generator, similar to velvet noise, that produces a random series of impulses at a specified rate in Hz.

⤋ Read More

GitHub Enterprise Server 3.2 is now generally available
Today, we’re excited to announce that GitHub Enterprise Server 3.2 is generally available. This release brings over 70 new features and changes that improve developer experience and deliver new security capabilities. ⌘ Read more

⤋ Read More

Peter Saint-Andre: Opinions Weak and Strong
Continuing a thread that I started to explore earlier this year, I’d like to take a closer look at the intensity of opinions. Here as almost everywhere, there is a continuum: we all have opinions we hold strongly and opinions we hold weakly. Not only do the specific contents of these buckets change over time, but in general the intensity of one’s opinions can change over time, too. We’re all familiar with the sophomoric young adult who has strong opinions about everything (yes, I resemb … ⌘ Read more

⤋ Read More

What’s new from GitHub Changelog? August 2021 Recap
What did we ship in August? Codespaces, Discussions, and lots of other updates, from the general availability of the dark high contrast theme to an auto-generated table of contents for wikis. ⌘ Read more

⤋ Read More

Hating Brave is Cool!

Image

I like and use the Brave Browser.It’s a free and open source browser with features like:

  1. Ad-blocking by default.
  2. Tracker-blocking by default.
  3. Anti-fingerprinting mechanisms to prevent you from being monitored.
  4. Built-in Tor windows.
  5. Run by a based Christian and not furry leftists.

As far as I’m concerned, Brave is indisputably the best general-purpose browser out there.There are other okay brows … ⌘ Read more

⤋ Read More

2x3: {lives in social/physical reality}×{views things generally as positive/zero/negative sum}. To be honest, I think there’s relatively few people in social positive sum reality frames.

⤋ Read More

@jlj@twt.nfld.uk “A good read: Why I find longtermism hard – […]” -> Interesting! I don’t particularly share that emotional intuition (although my bias probably cuts the other way: I am more moved by interesting projects, and more interesting problems probably also less neglected)–I generally find most problems other people find salient not very moving at all (although probably equally strongly moved by extremely near suffering compared to other people, but with a stronger emotional distance discount). EA makes sense in a very different way to me (phenomenologically, probably closest to philosophical high valence states it evokes).

⤋ Read More

new algorithm in @!(ref “sndkit”)!@: @!(sndkitref “phasor”)!@ generates a normalized periodic ramp signal, typically used for table-lookup oscillators.

⤋ Read More

“Everyone who had serious philosophical conundra on that subject just, you know, died, a generation before. The Bitchun Society didn’t need to convert its detractors, just outlive them.”

⤋ Read More

My relationship to compliments in those days was simple: I didn’t give any and I didn’t receive any either. Talking openly about feelings - or heaven forbid - giving praise - simply wasn’t the norm. This was especially so with the older generation, people like my granddad. How to Compliment | Less Penguiny

⤋ Read More
In-reply-to » Anyone here good with Go and feel like helping me build our a "Direct Messages" feature? I was going to pay someone on Upwork to do this, but I've received very few applicants (just one!) and they aren't that good (stock standard crappy Bootstrap experience and no evidence of any experience with Go).

@prologic@twtxt.net Ok.. so using NaCL boxes. yeah its just a combo of using secretbox with a generated key/nonce. and then using the pubkey box to encrypt the key/nonce for each device.

⤋ Read More
In-reply-to » Anyone here good with Go and feel like helping me build our a "Direct Messages" feature? I was going to pay someone on Upwork to do this, but I've received very few applicants (just one!) and they aren't that good (stock standard crappy Bootstrap experience and no evidence of any experience with Go).

@prologic@twtxt.net Ok.. so using NaCL boxes. yeah its just a combo of using secretbox with a generated key/nonce. and then using the pubkey box to encrypt the key/nonce for each device.

⤋ Read More
In-reply-to » Anyone here good with Go and feel like helping me build our a "Direct Messages" feature? I was going to pay someone on Upwork to do this, but I've received very few applicants (just one!) and they aren't that good (stock standard crappy Bootstrap experience and no evidence of any experience with Go).

@prologic@twtxt.net sender generates an AES key encrypts message. gets the device list for user and encrypts key for each device. sends the encryptedkeys+cypertext.

⤋ Read More
In-reply-to » Anyone here good with Go and feel like helping me build our a "Direct Messages" feature? I was going to pay someone on Upwork to do this, but I've received very few applicants (just one!) and they aren't that good (stock standard crappy Bootstrap experience and no evidence of any experience with Go).

@prologic@twtxt.net sender generates an AES key encrypts message. gets the device list for user and encrypts key for each device. sends the encryptedkeys+cypertext.

⤋ Read More
In-reply-to » Anyone here good with Go and feel like helping me build our a "Direct Messages" feature? I was going to pay someone on Upwork to do this, but I've received very few applicants (just one!) and they aren't that good (stock standard crappy Bootstrap experience and no evidence of any experience with Go).

@prologic@twtxt.net for encryption. we can have browser/app generate ec25519 keypair. store the private on device and add pub to list of devices for the user on pod.

⤋ Read More
In-reply-to » Anyone here good with Go and feel like helping me build our a "Direct Messages" feature? I was going to pay someone on Upwork to do this, but I've received very few applicants (just one!) and they aren't that good (stock standard crappy Bootstrap experience and no evidence of any experience with Go).

@prologic@twtxt.net for encryption. we can have browser/app generate ec25519 keypair. store the private on device and add pub to list of devices for the user on pod.

⤋ Read More

Western culture has a very unhealthy attitude towards sleep in general. There is only one socially accepted sleep pattern: Eight hours a night, in one block, starting at between 10pm and 11pm and ending between 6am and 7am. This “early-bird” rhythm is celebrated in to the point of fetishisation and held up as the goal to which all productive adults must aspire. To behave otherwise is to be lazy, slothful, and not putting forward your all It’s Time to Stop Nap-Shaming | Hacker News

⤋ Read More