📣 NEW: Announcing the new and improved Yarns search engine and crawler! search.twtxt.net – Example search for “Hello World” Enjoy! 🤗 – @darch@neotxt.dk When you have this, this is what we need to work on in terms of improving the UI/UX. As a first step you should probably try to apply the same SimpleCSS to this codebase and go from there. – In the end (didn’t happen yet, time/effort) most of the code here in yarns will get reused directly into yarnd, except that I’ll use the bluge indexer instead.
I think Email has been broken on my Pod since some time now since @lyse@lyse.isobeef.org made this commit the default behaviour of the flags/env had changed requiring SMTP_PORT to be set (used to default toi 25) ooops 😅
HM [03;03;07]: 8 mile run: 9.16 miles, 00:12:24 average pace, 01:53:31 duration
met up to run with beth for her 10k time trial
#running
Happy 5th birthday, A Hat In Time!
❤️ 🎶: Good Times by Davey Nate
❤️ 🎶: Time by Yerin
analog circuit debugging is a transcendental experience. every.single.time. #electronics
analog circuit debugging is a transcendental experience. every.single.time. #electronics
Read the first 50 pages, if the author hasn’t earned your attention by then, you can stop reading. You’ll never read all the good books anyway, don’t waste your time on the bad ones. Reading fast, reading well, and reading widely (2020) | Hacker News
❤️ 🎶: As Time Goes by by Yoon Mi Rae (T)
Hard times create strong men. Strong men create autocratic dynasties. Autocratic dynasties create supernumerary bureaucracies. Supernumerary bureaucracies create eunuch castes. Eunuch castes create drama. Drama creates Heavenly displeasure. Heavenly displeasure creates hard times. Book Review: 1587, a Year of No Significance | Hacker News
Universe Price Tiers
⌘ Read more
In about four months’ time, if the replacement doesn’t ship from IndieGoGo before then, I will have been using my current smartphone for five years.
(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 ObjectsA 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
}
@mckinley@twtxt.net Haha, while composing I was wondering two or three times whether I should throw my thoughts in an HTML page instead. But out of utter laziness I discarded that idea. ¯_(ツ)_/¯
I did a take home software engineering test for a company recently, unfortunately I was really sick (have finally recovered) at the time 😢 I was also at the same time interviewing for an SRE position (as well as Software Engineering).
Got the results of my take-home today and whilst there was some good feedback, man the criticisms of my work were harsh. I’m strictly not allowed to share the work I did for this take-home test, and I really can only agree with the “no unit tests” piece of the feedback, I could have done better there, but I was time pressured, sick and ran out of steam. I was using a lot of libraires to do the work so in the end found it difficult to actually think about a proper set of “Unit Tests”. I did write one (in shell) but I guess it wasn’t seen?
The other points were on my report and future work. Not detailed enough I guess? Hmmm 🤔
Am I really this bad? Does my code suck? 🤔 Have I completely lost touch with software engineering? 🤦♂️
Tengo el bicho, one-more-time, ¿quién me lo pegó?… un bakunado.
Tengo el bicho, one-more-time, ¿quién me lo pegó?… un bakunado.
I wonder if KISS sets are still a thing. I loved making them a very long time ago.
Time to go to sleep, hoping I do get any given how how it is here right now…
I’m excited for the travel I’m going to be doing over the next few days, but the downside is that I’m not going to have much time to sleep.
All the scripts on my Gemini capsule (except chess) have now been rewritten using Python and storing data in a SQLite database. This is the first time I’ve ever worked with database in a “production” environment, and I’m inordinately excited.
Spent the afternoon updating my tilde and now it is time to unwind with some meditation and a book!
@movq@www.uninformativ.de I usually only use eggs for baking or fry them for potatoes and spinach. @prologic@twtxt.net Why don’t you have them anymore? Did the fox get them all when the door didn’t close in time? ]:->
❤️ 🎶: As time goes by [From “Reply 1988 (Original Television Soundtrack), Pt. 9”] by Kihyun
All this time spent being grumpy about how adding my Now updates directly into the html page is uncomfortable, and it just occurred to me I can chug it into a text file and use cat.
I’m reminded today that books are still a great form of entertainment. Secondhand books in particular are always plentiful and cheap–a big plus in times of supply chain squeezes and rampant inflation.
We’re lovers only during the good times, and a burden to each other in the bad times. Quotes From ‘Twenty-Five Twenty-One’ that will make Your Heart Ache | allkpop
Goofs
⌘ Read more
We don’t have meaningful social connections anymore like our parents or their parents geeration had. We are so scattered, that I am unsure how many of my friends are actually friends and how many are just professional contacts. Everytime I switch job, almost 70% of my friends suddenly fall out of contact. Heck, I don’t even know the people who live in next apartments both left, right, up and down on the same building. Socializing with my friends mean, setting up an appointment weeks ahead to see if we can align on a free-slot and this often involves all of us commuting to somewhere and disbanding by 22:00 hours because family, work next morning, chores to do, doctor appointment and other human things. Why do you waste so much time on the internet? | Hacker News
Spent the last few days debugging network issues at work.
Exhausting. You never get a full picture. You poke a little here, poke a little there, … Form a hypothesis and test it. Eventually, maybe, you can narrow it down a bit to some segment or even some component.
A very time consuming process. Even more so if you try not to cause downtimes for your users.
I want a magical device that allows me to look inside a cable/fibre.
But hey, at least we got rid of a bunch of Cisco switches in the process. So there’s that.
Mainly Known For
⌘ Read more
Time for some ice cream I think!
📚 Finished reading A Random Walk Down Wall Street: The Time-Tested Strategy for Successful Investing by Burton G. Malkiel
“We build our computer systems like we build our cities - over time, without a plan, on top of ruins.” — Ellen Ullman Ellen Ullman: We Have to Demystify Code (2017) | Hacker News
📚 Finished reading A Random Walk Down Wall Street: The Time-Tested Strategy for Successful Investing by Burton G. Malkiel
I did the Wings for Life World Run today and I feel very good for the first time in a long time!
trying some day planning on paper, quantizing all tasks into pomodoros. feels good. my goal is to make software only if/when I’ll feel I’ll need it and have a pretty decent idea of WHAT I need #tracking #selfimprovement #time
trying some day planning on paper, quantizing all tasks into pomodoros. feels good. my goal is to make software only if/when I’ll feel I’ll need it and have a pretty decent idea of WHAT I need #tracking #selfimprovement #time
❤️ 🎶: At that time by Kim Na Young
❤️ 🎶: For a Long Long Time by Semin Lim
❤️ 🎶: Leave work on time by Lee Yi Kyung
Family Reunion
⌘ Read more
I’ve always found that “living at my means” has paid dividends. To many folks, ‘round these parts, they’d consider it “living below my means,” but that’s mostly because they “live beyond their means.” Ask HN: How can I prepare for hard economic times? | Hacker News
I would HIGHLY recommend reading up on the keybase architecture. They designed device key system for real time chat that is e2e secure. https://book.keybase.io/security
A property of ec keys is deriving new keys that can be determined to be “on curve.” bitcoin has some BIPs that derive single use keys for every transaction connected to a wallet. And be derived as either public or private chains. https://qvault.io/security/bip-32-watch-only-wallets/
Consensus Time
⌘ Read more
So many interesting projects, so little time … and also so many excuses
Took a flu medicine last night, and it knocked me down around 22:00. Woke up at 04:00, then slept till 06:30. All has been seemingly fine, not feeling sleepy, and mostly alert… until now. I am having a really hard time keeping my eyes open. 😬
❤️ 🎶: Beyond The Time by Janet Suhh
I’ve heard that being a soldier in a combat zone is long hours of idleness, punctuated by short periods of terror and stress. That pretty much describes my time as a manager, without the “terror” part (and the bullets and explosions). People don’t work as much as they say | Hacker News