Searching We.Love.Privacy.Club

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

** week notes **
Some things of note, links mostly:

First and foremost, I found a suitable pinboard replacement in link hut! Shout outs to my buddy Bruno for the tip.

Here’s a bookmarklet I wrote to make it a bit more ergonomic for how I like to roll,

 javascript
javascript:(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">const</span> tags = prompt(<span class="hljs-string">'A space separated list of tags.' ... ⌘ [Read more](https://eli.li/2023/03/31/week-notes)

⤋ 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

Lindypress Bug Fix
Just a brief note that for the past couple of days, you might’ve been unable to buy books on LindyPress.net if you are in the United States, Canada or Australia (which is a lot of you). This has now been fixed, so you can place your orders now!

The issue was that there was a silent API update that kept addresses from validating states and provinces. Note that if your order placed, it’s all okay, this is only for people for whom the site would not let place an order.
… ⌘ Read more

⤋ Read More

Lindypress Bug Fix
Just a brief note that for the past couple of days, you might’ve been unable to buy books on LindyPress.net if you are in the United States, Canada or Australia (which is a lot of you). This has now been fixed, so you can place your orders now!

The issue was that there was a silent API update that kept addresses from validating states and provinces. Note that if your order placed, it’s all okay, this is only for people for whom the site would not let place an order.
… ⌘ Read more

⤋ Read More

** Accessibility updates **
I’m feeling pretty chuffed! Last week I wrote about my intention to make this website more accessible. My motivations were many-fold, but, primarily, mostly shame. I’ve worked as an accessibility specialist in the past, and now spend a bunch of my days at work looking for ways to make public infrastructure online more accessible. It seemed fitting to at least make sure the little bit I contribute to the web here is also accessible.

I thought it was going t … ⌘ Read more

⤋ Read More

In reply to: Oatmeal - week notes

The worst kind of blogging is blogging about blogging, so, I’ll keep this blogging about blogging short!

I’ve made some minor updates to the design of the website that have improved it’s usability a wee bit, and are a step in the right direction toward upping my accessibility game. The major remaining accessibility issues are around color contrast and some structura … ⌘ Read more

⤋ Read More

** week notes **
It got a wee bit cold here in Maine this weekend. It was thankfully uneventful for us. We hung around inside and watched it get real cold outside. Our home faired pretty well, too. Honestly pleasantly surprised about that!

We picked this weekend to go all in on potty training — pantsless days, treats, rousing bouts of encouragement sung, and a lot of spot cleaning. Fueled by hubris, I thought we had this potty trainin … ⌘ Read more

⤋ Read More

(Communiqué) L’énergie du désespoir
Suite à la demande d’un lecteur assidu, je reproduis ici la tribune, déjà publiée vendredi par Olivier Delamarche et Nicolas Meilhan, adressée par les acteurs des territoire de l’Ain, de Savoie et Haute Savoie à l’adresse du Président Macron au sujet de la crise énergétique qui les frappe de plein fouet. Note à mes lecteurs […] ⌘ Read more

⤋ Read More

Snikket: Notes on the F-Droid security warning
Snikket Android users who installed the app via F-Droid may receive a warning
from F-Droid telling them that the app has a vulnerability and that they
“recommend uninstalling immediately”. First of all - don’t panic! This is a
over-simplified generic warning that is scary, but the actual situation is
not quite so scary and has an explanation. Here goes…

How F-Droid works

When an app is developed and ready for release, it must be compiled and built,
to produce the fina … ⌘ Read more

⤋ Read More

Jérôme Poisson: Libervia progress note 2022-W45
Hello, it’s time for a long overdue progress note.

I’ll talk here about the work made on ActivityPub (AP) gateway and on end-to-end encryption around pubsub.

Oh, and if everything goes well, this blog post should be accessible from XMPP and ActivityPub (and HTTP and ATOM feed), using the same identifier goffi@goffi.org.

Forewords

The work made on the AP gateway has been possible thanks to a NLnet/NGI0 grant (w … ⌘ Read more

⤋ Read More

** Occasional notes **
If they aren’t weekly, I guess they’re occasional?

3rd repair procedure to fix brain bleed was a success. I have a few more scans and follow ups, but, knock wood I think I’m through at this point.

I’ve spent about a week laying low and taking it easy navigating some wild pain, but that is subsiding now. I watched a bunch of stuff. It was a nice change of pace. I don’t typically watch much television or many movies. Stand outs (all things I revisited) include:

  • Michael Clayton
  • Point Break, the o … ⌘ Read more

⤋ Read More

** week notes **
Am I allowed to call them“week notes” if I don’t do them weekly?

I went in for what was supposed to be my final brain scan, a diagnostic angiogram (don’t look that up). The good news is that the repair has officially cured my brain bleed! The bad news is that they saw another vessel that looks primed to bleed; I’m due for another repair procedure sometime in October. I’m pretty bummed to not be done with this ordeal, but trying to remain optimistic that this new one was caught before it bled and because the surgeon s … ⌘ Read more

⤋ Read More

Une presse française lâche et paresseuse
Ah, finalement, qu’il est doux d’être journaliste en France dans un journal de révérence ! Jadis, c’était un travail fatigant, voire stressant et parfois même risqué : il fallait aller chercher l’information directement sur le terrain et la corroborer le carnet de notes à la main. Certains événements pouvaient impliquer de mettre sa vie en danger ; et […] ⌘ 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