When I tell this story, all Americans 🇺🇸 and most British 🇬🇧 don’t believe me.
Italy 🇮🇹 cannot have startups by design. This is due many items, starting with the untranslable “studio di settore”.
The 🇮🇹 tax authorities assume that given x company assets you MUST make a profit 1/5
A list of European alternatives to Internet services—hosting, VPNs, mailing lists, etc.
With open source alternatives that can be run anywhere.
Most of them really care about privacy in contrast with US services.
european-alternatives.eu/cat…
Americans live with the constant threat of being fired if they don't work hard enough. During times of crisis, as here ~2008 and ~2020, the screws are tightened, the goalposts are moved, and even more "productivity" is squeezed out of them
Before anyone gets upset, yes, we all know there is a big difference between the Book of Mormon and a React conference.
One is the testimony of devoted followers preaching the true path to salvation through a single way of thinking, and the other is a book.
The Netanyahu regime now pulling off the rare feat of violating both the Geneva Conventions and the Vienna Convention—at the same time. You're living through history, folks.
This morning began with the revelation of Israel’s gruesome Shifa Hospital massacre.
A few hours later, Israel bombed a diplomatic compound - an embassy - in Syria.
Tonight it has murdered several foreign aid workers in an airstrike on their car in Gaza.
How can one type a function in TypeScript, such that it takes a Record where keys must follow a pattern of `${'foo'|'bar'}_${string}`; but *cannot have a mix 'foo' and 'bar' substrings among all keys of the object*?, e.g.:
ALT TypeScript code:
// this is OK
myFunction({
bar_1: 1,
bar_2: 2,
});
// this is OK
myFunction({
foo_1: 1,
foo_2: 2,
});
// this is NOT OK, because it uses both 'bar' and 'foo'
myFunction({
bar_1: 1,
foo_2: 2,
});
// this is NOT OK, because they substring is neither 'foo' nor 'bar'
myFunction({
fob_2: 2,
});
Curiously, even writing it as an explicit discriminated union doesn't seem to work
ALT typescript code:
type AllowedRecord =
| {
[K in `foo_${number}`]: unknown;
}
| {
[K in `bar_${number}`]: unknown;
};
function myFunction2(obj: AllowedRecord) {
// implementation
}
myFunction2({ foo_1: 1, foo_2: 2 }); // OK
myFunction2({ bar_1: 1, bar_2: 2 }); // OK
myFunction2({ bar_1: 1, foo_2: 2 }); // should not be OK !
This color picker deserves your attention: OKHSL and OKHSV (based on OKLAB; all by @bjornornorn) are such simple and pragmatic ways to pick colors and build palettes—much more intuitive than LCH, while retaining the same advantages
I created a color picker that better matches human perception. It uses two new sRGB gamut color spaces based on Oklab called Okhsv and Okhsl. ok-color-picker.netlify.app/
I could teach a day or two worth of workshops teaching how react-aria accomplishes all the power and flexibility just from what's on this page: react-spectrum.adobe.com/rea…
Really awesome patterns!
Finally logged in to @withgraphite again after probably more than a year — I use the CLI every day all day; but still waiting on GitLab integration, to get back on the platform 😐😬... 🙏
app.graphite.dev/launch/prof…
In my TypeScript nerd journey this past year, one frustration has been that I never manage to do quite as much with generic functions as I can with types, when it comes to inferring and transforming
I end up doing the wizard stuff on the type layer with a separate parametric type, and then writing a runtime implementation annotated with `unknown`s and/or `any`s, and then asserting `as TransformedType<T>` on the `return` statement
I enjoy the power of working on the type layer, but it's irritating to have to bail out of TS in the actual implementation code (and irksome—it feels like "working without a wire"). Is this typical, or am have I missed a step?