From 446fd8e78675b8458bcedddefe949936431d2747 Mon Sep 17 00:00:00 2001 From: Offirmo Date: Mon, 23 Sep 2024 09:30:15 +1000 Subject: [PATCH] +++ --- .../1-stdlib/ts--types/src/content.ts | 3 +- .../rich-text-format/README.md | 28 ++++- .../ts--types--web/{NOTES.md => notes.md} | 0 .../ts--types--web/src/01-links/index.ts | 75 +---------- .../ts--types--web/src/01-links/selectors.ts | 24 ++++ .../ts--types--web/src/01-links/types.ts | 116 ++++++++++++++++++ .../lists/senior-dev/tech-bites--concepts.md | 1 + ...es--web.md => tech-bites--frontend-web.md} | 4 + .../tech-bites--product-and-strategy.md | 1 + .../lists/senior-dev/tech-bites--system.md | 4 +- .../lists/serious-memes/mental-models.md | 3 + .../active--no-pkg/disrupt/pdf/NOTES.md | 4 +- .../src/generate--well-known/notes.md | 3 + .../9-rpg/xx-notes/common/notes--UI.md | 27 ++++ .../common/notes--character--customization.md | 1 + .../setting--fantasy/notes--middleage.md | 3 + 16 files changed, 216 insertions(+), 81 deletions(-) rename stack--current/3-advanced/ts--types--web/{NOTES.md => notes.md} (100%) create mode 100644 stack--current/3-advanced/ts--types--web/src/01-links/selectors.ts create mode 100644 stack--current/3-advanced/ts--types--web/src/01-links/types.ts rename stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/{tech-bites--web.md => tech-bites--frontend-web.md} (99%) create mode 100644 stack--current/9-rpg/xx-notes/common/notes--UI.md create mode 100644 stack--current/9-rpg/xx-notes/setting--fantasy/notes--middleage.md diff --git a/stack--current/1-stdlib/ts--types/src/content.ts b/stack--current/1-stdlib/ts--types/src/content.ts index c1cf847b..b132eadb 100644 --- a/stack--current/1-stdlib/ts--types/src/content.ts +++ b/stack--current/1-stdlib/ts--types/src/content.ts @@ -6,7 +6,8 @@ import { IETFLanguageType } from './international.js' // REFINED in @offirmo-private/ts-types-web export type Emoji = string -export type Url‿str = string +export type Uri‿str = string +export type Url‿str = Uri‿str export type Email‿str = string export interface SocialNetworkLink { diff --git a/stack--current/3-advanced--multi/rich-text-format/README.md b/stack--current/3-advanced--multi/rich-text-format/README.md index 41a60faa..caa610a8 100644 --- a/stack--current/3-advanced--multi/rich-text-format/README.md +++ b/stack--current/3-advanced--multi/rich-text-format/README.md @@ -1,10 +1,24 @@ -A generic, platform independent rich text format. -It's half-way between raw text and html. It has only 1 dimension. +A generic, platform-independent, rich text format -Can be rendered in ascii, html, react... +The goal is to +- be semantic +- be render-able in both terminal and browser = ascii, html, react... + +This format is half-way between raw text and html, a bit similar to Markdown. + +It has only 1 dimension (flow) but hints can be added to render in a more fancy way if supported. Ex. a "ul/ol" hint. + +It has an underlying JSON structure. See `/demos/*` + +A notable difference with other document formats (Atlassian, Slack...) is that we don't have an array of children. +Instead, a text with references to other nodes is used. Advantages: +- a bit more readable +- we can re-use nodes +- we can over-supply nodes and not always use them +Disadvantages +- verbose for lists -See /demos/* ```js import * as RichText from '@offirmo-private/rich-text-format' @@ -24,7 +38,7 @@ console.log(RichText.renderⵧto_actions($doc)) ``` Inspiration: -* "Atlassian Document Format" https://bitbucket.org/atlassian/adf-builder-javascript#readme +* "Atlassian Document Format" https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/ Related, discovered after I made mine: * Slack's "block kit" https://api.slack.com/block-kit @@ -35,3 +49,7 @@ Related, discovered after I made mine: Tosort * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl * https://formatjs.io/docs/core-concepts/icu-syntax/ + + +TODO add emoji support +TODO add hypermedia as first class? diff --git a/stack--current/3-advanced/ts--types--web/NOTES.md b/stack--current/3-advanced/ts--types--web/notes.md similarity index 100% rename from stack--current/3-advanced/ts--types--web/NOTES.md rename to stack--current/3-advanced/ts--types--web/notes.md diff --git a/stack--current/3-advanced/ts--types--web/src/01-links/index.ts b/stack--current/3-advanced/ts--types--web/src/01-links/index.ts index baec3370..68d60b86 100644 --- a/stack--current/3-advanced/ts--types--web/src/01-links/index.ts +++ b/stack--current/3-advanced/ts--types--web/src/01-links/index.ts @@ -1,73 +1,2 @@ - - -import type { - Url‿str as SimplerUrl‿str, - SocialNetworkLink as SimplerSocialNetworkLink, -} from '@offirmo-private/ts-types' - -import { WithLang } from '../00-base/index.js' - -///////////////////////////////////////////////// - -type Url‿str = SimplerUrl‿str -// protocol - -//////////// - -type SocialNetworkId = - | 'artstation' - | 'facebook' - | 'github' - | 'instagram' - | 'itch.io' // https://itch.io/profile/xyz - | 'linkedin' - | 'producthunt' - | 'reddit' - | 'twitch' - | 'ko-fi' // https://ko-fi.com/xyz - | 'twitter' // we keep "twitter" as an internal id, "X" is too generic - -interface SocialNetworkLink extends SimplerSocialNetworkLink { - url: Url‿str // mandatory - handle?: string // ex @Offirmo, u/Offirmo - network: SocialNetworkId // helps to parse. Not optional bc I can add if missing -} - -//////////// - -// TODO new Url spec -// https://en.wikipedia.org/wiki/Wikipedia:Bare_URLs -// https://en.wikipedia.org/wiki/Wikipedia:Link_rot -// TODO https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007899 -// skip link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#skip_links -interface Link extends WithLang { - // do we endorse this link? - // should we add ref? - // follow? - // etc... - - // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a - // download - // href - // ping - // referrer policy - // target... - // attribution https://wicg.github.io/attribution-reporting-api/?sjid=5871821160398133867-AP#monkeypatch-attributionsrc - - /* - Using target="_blank" without rel="noreferrer" and rel="noopener" makes the website vulnerable to window.opener API exploitation attacks, - although note that, in newer browser versions setting target="_blank" implicitly provides the same protection as setting rel="noopener". - See browser compatibility for details. - (beware Android WebView!) - */ -} - -///////////////////////////////////////////////// - -export { - type Url‿str, - type SocialNetworkId, - type SocialNetworkLink, - - type Link, -} +export * from './types.js' +export * from './selectors.js' diff --git a/stack--current/3-advanced/ts--types--web/src/01-links/selectors.ts b/stack--current/3-advanced/ts--types--web/src/01-links/selectors.ts new file mode 100644 index 00000000..1298b0e4 --- /dev/null +++ b/stack--current/3-advanced/ts--types--web/src/01-links/selectors.ts @@ -0,0 +1,24 @@ +import assert from 'tiny-invariant' + + +import type { URI‿x, SchemeSpecificURIPart } from './types.js' + + +///////////////////////////////////////////////// + +function getꓽscheme_specific_partⵧfrom_URLObject(url: URL): SchemeSpecificURIPart { + throw new Error(`NIMP!`) +} + +function getꓽscheme_specific_part(link: URI‿x): SchemeSpecificURIPart { + if (typeof link !== 'string') + return link + + return getꓽscheme_specific_partⵧfrom_URLObject(new URL(link)) +} + +///////////////////////////////////////////////// + +export { + getꓽscheme_specific_part +} diff --git a/stack--current/3-advanced/ts--types--web/src/01-links/types.ts b/stack--current/3-advanced/ts--types--web/src/01-links/types.ts new file mode 100644 index 00000000..370e2857 --- /dev/null +++ b/stack--current/3-advanced/ts--types--web/src/01-links/types.ts @@ -0,0 +1,116 @@ +import type { + SocialNetworkLink as SimplerSocialNetworkLink, +} from '@offirmo-private/ts-types' + +import { WithLang } from '../00-base/index.js' + +///////////////////////////////////////////////// + +type Uri‿str = string +type Url‿str = Uri‿str + +//////////// + +type SocialNetworkId = + | 'artstation' + | 'facebook' + | 'github' + | 'instagram' + | 'itch.io' // https://itch.io/profile/xyz + | 'linkedin' + | 'producthunt' + | 'reddit' + | 'twitch' + | 'ko-fi' // https://ko-fi.com/xyz + | 'twitter' // we keep "twitter" as an internal id, "X" is too generic + +interface SocialNetworkLink extends SimplerSocialNetworkLink { + url: Url‿str // mandatory + handle?: string // ex @Offirmo, u/Offirmo + network: SocialNetworkId // helps to parse. Not optional bc I can add if missing +} + +//////////// + +interface SchemeSpecificURIPart { + // TODO clarify encoding + + // authority: not needed for now + + /** Core property + */ + path: string + + /** (optional) non-hierarchical data + * https://en.wikipedia.org/wiki/Query_string + * - The exact structure of the query string is not standardized. Methods used to parse the query string may differ between websites. + * NOTE: in-scope of the scheme + * * considered "unclean", try to not abuse + * NOT necessarily a key/value store + */ + query: string // TODO or query params or anything + + /** (optional) sub-resource identifier, sub-set, portion of the primary rsrc or view = representation the resource + * https://en.wikipedia.org/wiki/URI_fragment + * recommended to only use when it's not practical to serve the sub-rsrc independently https://www.w3.org/TR/cooluris/ + * NOTE: independent of the scheme + * ex. :~:text=whatever + */ + fragment?: string + + /** (optional) the immediate parent in the cascade. Useful to resolve the full URI IF NEEDED + * TODO clarify how to set a "encapsulating URI" for properly detecting and resolving relative URIs + */ + parent?: SchemeSpecificURIPart +} + +type URI‿x = Uri‿str | SchemeSpecificURIPart + +///////////////////////////////////////////////// + +type LinkRelation = string + +/** A more generic hyperlink than HTML's + * following hypermedia theory + */ +interface Hyperlink extends WithLang { + href: URI‿x + + /** + * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel + */ + rel: LinkRelation[] // https://www.iana.org/assignments/link-relations/link-relations.xhtml + + cta?: string // if present, replace / complement the anchor content + + target?: never // TODO clarify + + // referrer TODO + // opener TODO + + // do we endorse this link? + // should we add ref? + // follow? + // etc... + + // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a + // download + // href + // ping + // referrer policy + // attribution https://wicg.github.io/attribution-reporting-api/?sjid=5871821160398133867-AP#monkeypatch-attributionsrc +} + +///////////////////////////////////////////////// + +export { + type Url‿str, + + type SocialNetworkId, + type SocialNetworkLink, + + type URI‿x, + type SchemeSpecificURIPart, + type LinkRelation, + type Hyperlink, +} diff --git a/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--concepts.md b/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--concepts.md index 0e93c738..96be62f4 100644 --- a/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--concepts.md +++ b/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--concepts.md @@ -74,6 +74,7 @@ changelog -- conventional https://github.com/conventional-changelog changelog -- standard https://keepachangelog.com/ https://common-changelog.org/ CI (Continuous Integration) https://www.browserstack.com/guide/difference-between-continuous-integration-and-continuous-delivery class +clever code considered harmful https://www.joshwcomeau.com/career/clever-code-considered-harmful/ client/server -- multi-tier architecture close / destroy / terminate / dispose / release / free / delete / destruct / finalize / teardown / cleanup / shutdown / stop / end / abort / cancel / halt / kill / exit / quit / unload / dispose... code is the enemy = It can go wrong, and it needs maintenance. Write less code. Delete code. Don’t write code you don’t need https://opensource.com/article/17/5/30-best-practices-software-development-and-testing diff --git a/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--web.md b/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--frontend-web.md similarity index 99% rename from stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--web.md rename to stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--frontend-web.md index 4de4b6de..8aa61369 100644 --- a/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--web.md +++ b/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--frontend-web.md @@ -99,6 +99,7 @@ CSS -- width = auto, fit-content, min-content https://courses.joshwcomeau.com/cs CSS -- z-index CSS -- zoom https://www.oddbird.net/2024/07/09/zoomies/ CSS https://developer.mozilla.org/en-US/docs/Learn/CSS/First_steps/Getting_started +dark patterns https://www.uxtigers.com/post/dark-design data fetching https://martinfowler.com/articles/data-fetch-spa.html design -- guides https://owickstrom.github.io/the-monospace-web/ devices -- support @@ -134,9 +135,11 @@ GraphQL GraphQL -- against https://bessey.dev/blog/2024/05/24/why-im-over-graphql/ HTML -- concepts HTML -- elements +html -- first https://html-first.com/ html -- metadata https://github.com/wikimedia/html-metadata HTML -- tags htmx https://htmx.org/ +hypercard https://hypercard.org hypermedia hypertext i18e Ecosystem Performance = Cleanup, Speedup, Levelup. One Package at a time. https://e18e.dev/ @@ -209,6 +212,7 @@ response times https://www.nngroup.com/articles/response-times-3-important-limit security -- clickjacking https://portswigger.net/web-security/clickjacking security -- cross-site leaks https://xsleaks.dev/ security -- in-app browsers https://krausefx.com/blog/ios-privacy-instagram-and-facebook-can-track-anything-you-do-on-any-website-in-their-in-app-browser +spirit -- view source affordance https://htmx.org/essays/right-click-view-source/ SSR good explanation https://single-spa.js.org/docs/ssr-overview/ temporal dead zone (TDZ) https://devdocs.io/javascript/statements/let#temporal_dead_zone_tdz testing -- component https://storybook.js.org/blog/component-testing/ diff --git a/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--product-and-strategy.md b/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--product-and-strategy.md index 9fdcb6d0..aae20510 100644 --- a/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--product-and-strategy.md +++ b/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--product-and-strategy.md @@ -32,6 +32,7 @@ enterprise -- cross-orgs (shared channels) enterprise -- data residency enterprise -- drafts enterprise -- personal workspace = to use the feature for themselves +enterprise -- regulated industries enterprise -- security enterprise -- similar enterprise -- SSO diff --git a/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--system.md b/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--system.md index 12142632..f8d36e94 100644 --- a/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--system.md +++ b/stack--current/5-incubator/active--no-pkg/bite-sized/lists/senior-dev/tech-bites--system.md @@ -11,6 +11,7 @@ [ ] https://carloarg02.medium.com/how-i-scaled-amazons-load-generator-to-run-on-1000s-of-machines-4ca8f53812cf [ ] https://medium.com/@sureshpodeti/system-design-twitter-a98e7d134634 [ ] https://newsletter.pragmaticengineer.com/p/building-the-threads-app +[ ] https://slack.engineering/scaling-datastores-at-slack-with-vitess/ [ ] https://www.infoq.com/news/2024/01/discord-midjourney-performance/ [ ] https://www.youtube.com/watch?v=paTtLhZFsGE [ ] kubernetes @@ -26,7 +27,6 @@ [ ] real case https://deno.com/blog/how-we-built-jsr [ ] research papers: https://medium.com/@rohitverma_87831/my-interview-experience-at-google-afc1080df175 [ ] Software Engineering Advice from Building Large-Scale Distributed Systems -[ ] https://slack.engineering/scaling-datastores-at-slack-with-vitess/ access control ACID -- 1 Atomicity = transactions are "all or nothing" ACID -- 2 Consistency = integrity constraints: "valid state" before AND after a transaction @@ -118,6 +118,7 @@ cloud native = leverages the full capabilities of the cloud, beyond storage and compliance compute confidentiality +config -- drift https://score.dev/ consistent Hashing containers containers -- images -- golden = pre-configured and optimised container images that serve as standardised and reusable foundations for building other images (apps, services...) @@ -458,3 +459,4 @@ well architected -- pillar -- performance efficiency = using IT and computing re well architected -- pillar -- reliability = consistently and correctly perform intended functions, Recover from infrastructure or service disruptions, Dynamically acquire computing resources to meet demand, Mitigate disruptions such as misconfigurations or transient network issues -- includes testing recovery procedures, scaling horizontally to increase aggregate system availability, and automatically recovering from failure. well architected -- pillar -- security = protecting information, systems, and assets while delivering business value through risk assessments and mitigation strategies -- Automate security best practices when possible, Apply security at all layers, Protect data in transit and at rest. well architected -- pillar -- sustainability = minimizing the environmental impact of your technology -- Understand your impact, Establish sustainability goals, Maximize utilization, Anticipate and adopt new, more efficient hardware and software offerings, Use managed services, Reduce the downstream impact of your cloud workloads +workload https://score.dev/ diff --git a/stack--current/5-incubator/active--no-pkg/bite-sized/lists/serious-memes/mental-models.md b/stack--current/5-incubator/active--no-pkg/bite-sized/lists/serious-memes/mental-models.md index d3c2f741..abaa1acb 100644 --- a/stack--current/5-incubator/active--no-pkg/bite-sized/lists/serious-memes/mental-models.md +++ b/stack--current/5-incubator/active--no-pkg/bite-sized/lists/serious-memes/mental-models.md @@ -20,6 +20,7 @@ [ ] https://amir.rachum.com/mental-models/ [ ] https://boz.com/ [ ] https://en.wikipedia.org/wiki/Power_(social_and_political) +[ ] https://paulgraham.com/faq.html [ ] https://perell.com/essay/50-ideas-that-changed-my-life/ [ ] https://www.ted.com/playlists/171/the_most_popular_ted_talks_of_all_time [ ] wish I knew https://medium.com/mind-cafe/cheat-codes-for-life-i-know-at-36-that-i-wish-i-knew-at-26-294f6e865db5 @@ -279,6 +280,7 @@ pretty privilege -> karen primals https://myprimals.com https://templetonreligiontrust.org/explore/discovering-peoples-primal-world-beliefs/ priming principal-agent problem https://en.wikipedia.org/wiki/Principal–agent_problem +Principle of Least Power Prisoner's dilemma https://en.wikipedia.org/wiki/Prisoner%27s_dilemma prix au kilo problem solving -- structured https://strategyu.co/mckinsey-structured-problem-solving-secrets/ @@ -380,6 +382,7 @@ trust -- trust, but verify truth -- fully convinced vs probably https://christianity.stackexchange.com/questions/92352/believing-that-christianity-is-probably-true-vs-being-fully-convinced-that-ch truth -- verificationism https://christianity.stackexchange.com/a/89891 unlearn +vanilla verifiability https://en.wikipedia.org/wiki/Wikipedia:Verifiability via Negativa = When we have a problem, our natural instinct is to add a new habit or purchase a fix. But sometimes, you can improve your life by taking things away. For example, the foods you avoid are more important than the foods you eat. voleur volé diff --git a/stack--current/5-incubator/active--no-pkg/disrupt/pdf/NOTES.md b/stack--current/5-incubator/active--no-pkg/disrupt/pdf/NOTES.md index 8a2e1508..180a5488 100644 --- a/stack--current/5-incubator/active--no-pkg/disrupt/pdf/NOTES.md +++ b/stack--current/5-incubator/active--no-pkg/disrupt/pdf/NOTES.md @@ -23,7 +23,7 @@ https://www.researchgate.net/publication/324329159_How_Constraints_Affect_Conten diagrams https://d2lang.com/ - +https://viz-js.com/ ## Need for a long-term semantic format @@ -35,6 +35,8 @@ https://en.m.wikipedia.org/wiki/BBC_Domesday_Project https://www.canvasprotocol.org/ +https://www.notion.so/blog/data-model-behind-notion + ## hierarchy of file formats diff --git a/stack--current/5-incubator/active/generator--website-entry-points/src/generate--well-known/notes.md b/stack--current/5-incubator/active/generator--website-entry-points/src/generate--well-known/notes.md index c72d3e11..dd120af7 100644 --- a/stack--current/5-incubator/active/generator--website-entry-points/src/generate--well-known/notes.md +++ b/stack--current/5-incubator/active/generator--website-entry-points/src/generate--well-known/notes.md @@ -1,3 +1,6 @@ https://datatracker.ietf.org/doc/html/rfc8615 - registry: https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml + + +TODO https://llmstxt.org/ diff --git a/stack--current/9-rpg/xx-notes/common/notes--UI.md b/stack--current/9-rpg/xx-notes/common/notes--UI.md new file mode 100644 index 00000000..10d82e12 --- /dev/null +++ b/stack--current/9-rpg/xx-notes/common/notes--UI.md @@ -0,0 +1,27 @@ + +WoW menus: +- character Info + - character tab + - stats + - titles + - Equipment manager + - Reputation +- 🛠 Professions + - Primary + - First, Second + - recommended 1 gathering 1 crafting + - cooking, fishing, archaeology +- 🎯Talents & Spellbook + - Specialization + - Talents + - Spellbook + - class + - general +- 🏆Achievements +- ❗️Quest log +- Guild Finder +- Group Finder +- 🧲Warband Collections +- 📕Adventure Guide +- 💰Shop +- ❓Game Menu (escape) diff --git a/stack--current/9-rpg/xx-notes/common/notes--character--customization.md b/stack--current/9-rpg/xx-notes/common/notes--character--customization.md index 54d11b2a..b892c5d1 100644 --- a/stack--current/9-rpg/xx-notes/common/notes--character--customization.md +++ b/stack--current/9-rpg/xx-notes/common/notes--character--customization.md @@ -1,2 +1,3 @@ https://getavataaars.com/ +https://getavataaars.com/?accessoriesType=Blank&avatarStyle=Transparent&clotheColor=Gray01&clotheType=Hoodie&eyeType=Default&eyebrowType=DefaultNatural&facialHairColor=Black&facialHairType=BeardLight&hairColor=Black&mouthType=Smile&skinColor=Light&topType=ShortHairShortFlat diff --git a/stack--current/9-rpg/xx-notes/setting--fantasy/notes--middleage.md b/stack--current/9-rpg/xx-notes/setting--fantasy/notes--middleage.md new file mode 100644 index 00000000..e31e8225 --- /dev/null +++ b/stack--current/9-rpg/xx-notes/setting--fantasy/notes--middleage.md @@ -0,0 +1,3 @@ + + +https://en.wikipedia.org/wiki/Sark