My recent random thoughts

Nützliche Online Präsenz

Online präsent sein oder auf social media zu posten ist oder sollte kein Selbstzweck sein. Es gibt aber einige Vorteile die sich ergeben könnten:

  1. Helfen anderer z.B. bei ähnlichen Situationen die man hatte oder denen entsprechend der Content hilft
  2. Validieren von Ideen/Gedanken entdecken von Neuen durch eine größere Gruppe von Personen mit andere Erfahrungen, Ideen, ...
  3. Beeinflussen von anderen Personen um eigene Interessen voran zu treiben, z.B. Produkte verkaufen, Politik, ...
  4. Unterhalten - für mich der schwächste da auch bei den anderen punkten gegeben und für sich kein so großer Mehrwert

Man kann Clye auch gut als CMS benutzen

So funktioniert das auch auf meiner Homepage. Projects und Thoughts basieren einfach auch Clye queries die entsprechende Karten abrufen und dann auf der Website anzeigen. Praktisch ist das es sich entsprechen automatisch aktualisiert sobald ich Änderungen in Clye mache. Außerdem erlaubt Clye das kommentieren und reagieren und ich benötige keine eigene Implementierung dieser Dinge.

https://simon-vetter.de/

Das Ganze funktioniert über die API und ist so sehr flexibel in unterschiedliche Websites oder andere Systeme einbindbar.

Recursive regex replace in VSCode - Convert named imports to default imports

I wanted to make all imports to mui use direct links to the component, to speed upd bundling and improv development recompile speed. Therefore I tried to do it within vscode with regular expression, and i Came up with the following regular exression and replace code

import[\s\n]*\{[\s\n]*((\w+),?[\s\n])*\}[\s\n]*from "@mui/material"

import $2 from "@mui/material/$2"

However, this only works if only one this was importet. So I need somme way to replace the repeated part of the regular exression. This however is not possible to my knowledge. But no worries there is a funny workaround. Instead of replacing all in one stepp I can build a recursive replace algorithm that only transforms the first import to what I actually want, and converts the rest to an old import that will be matched again, as long as it has any imports in it.

import[\s\n]*\{[\s\n]*(\w+)[\s\n,]*([\s\n\w,]+)\}[\s\n]*from "@mui/material"

import $1 from "@mui/material/$1"
import { $2 } from "@mui/material"

The only problem left is a bunch of empty imports but they are easy to clean up

import[\s\n]*\{[\s\n]*\}[\s\n]*from "@mui/material"

This regex does the trick. So after about 25 runs all imports are refactored 👍

How to integrate Clye into your Typescript-Project

Clye Offers an api that allows you to integrate it with external systems. All API-Rotes are documented using OpenAPI. The Documentation can be found at https://clye.app/swagger and you can directly test it on this page.

This openapi spec allows you to generate a TypeScript client that enables typesafe access to all the good of Clye.

npx swagger-typescript-api -p https://clye.app/api/openapi.json -o ./src -n lib/api.ts

This command generate a src/lib/api.ts file that you can use to make all the requests and automate, import or do you custom stuff.

What is a good use of time? - (god in past, present & future)

There are always a few perspectives to look at a given time. You can look at it from the present, so while you experience it or from the future retrospectively or even from the past. The best time is the time that is enjoyable from all those directions. So something you look forward to, you enjoy in the moment and appreciate having experienced it looking back at it.

Now not every thing you do is something that has any relevance even a few moments before or after. For example watching a YouTube Video, it is enjoyable in the present, but you propably did not anticipate it and you propably will not even remember it a few moments later, so it is mostly a wast of time. However if you for example awaited it and enjoyed it and after it felt happy for some time it actually has a much higher worth.

The opposit is also true so this is also the case for negativ things. For example if you do not like to do the taxes you hat it in the past and propably in the present, but probably like it in the future.

If you want to maximize happieness there is a easy and a hard way. The easy way is always doing something in the present so you never think about the past or the future. This is in my opinion not actually maintainable because you are only happy in the present if the stimulation is higher the the last time which quickly raises unachievable levels.

The preferable way is to Choose activities wisely.

  • Do things you don't enjoy and can't avoid pretty early (so negative thoughts about it are relatively few)
  • Have concrete realistic goals/activities planned in the future you look forward to and will enjoy achieving/having achieved
  • Don't spend time during things in the present that do not affect the future => do things with as big as possible in the Future
  • Don't waste time thinking about impossibilities or pasts that do not help you in the future

Nicht nach Feedback sondern nach Tip für nächstes Mal fragen

Damit gibt es weniger Abneigung negatives zu sagen, da man so nicht direkt kritisiert. Außerdem führt es dazu das Konstruktive und meist konkretere Vorschläge dabei entstehen.

Component

Eine wiederverwandbare Funktion oder Klasse die mehrere UI elemente beschreibt und so das Wiederverwenden von UI und UI Logik ermöglicht

Es ist Rational Aufgaben erst zu machen wenn diese dringend sind

Podcast von Prof. Rieck

Was spricht für die Aussage

  • Wenn man zum prokrastinieren neigt ist dann die Motivation am höchsten die Aufgabe tatsächlich auch zu erledigen
  • Falls die Aufgabe vielleicht wegfallen könnte oder sich als nicht so relevant herausstellen könnte, kann man so potentiell Zeit sparen
  • Durch das nicht ausführen von nicht dringenden Aufgaben bleibt Zeit für dringenderes

Was spricht gegen die Aussage

  • Wenn sie vorher schon erledigt werden, werden sie nie dringend und damit schafft man sich potentiell Zeit in der Zukunft um auf neues dringendes zu regieren oder mehr Luft zu haben

Meine Conclusion

Die Dringlichkeit ist ein wichtiges Merkmal was in der Priorisierung eine große Rolle spielen sollte, allerdings sollte das nicht heißen das man Aufgaben erst dann beginnt wenn es schon fast zu spät ist. Generell ist hier aber ein spezielle definition von dringend die Kosten des nichts machens berücksichtigt

Nächste Seite

Simon Vetter © 2024

StartImpressum