1,788 karma · joined Mar 13, 2025 (1y ago) · 921 submissions
comment 1y ago · link · parent
const cached = new Map<string, Function>()
export function as<T>(o: any, path: string, as: (o: any) => T | undefined) {
try {
let fn = cached.get(path)
if (!fn) cached.set(path, fn = new Function('o', `return o.${path}`))
const v = fn(o)
return as(v) as T | undefined
}
catch (e) {
return undefined
}
}
as.number = (o: any) => (typeof o === 'number' ? o : undefined)
as.string = (o: any) => (typeof o === 'string' ? o : undefined)
as.boolean = (o: any) => (typeof o === 'boolean' ? o : undefined)
as.numbers = (len = 0) => (o: any) => (o instanceof Array && o.length >= len && o.every(c => typeof c === 'number') ? o : undefined)
as.strings = (len = 0) => (o: any) => (o instanceof Array && o.length >= len && o.every(c => typeof c === 'string') ? o : undefined)
const size = as(usrConfig, 'sys.size', as.numbers(2))
const fontpath = as(usrConfig, 'sys.font', as.string)comment 1y ago · link · parent
The only time status quo is fine is when it's for clients and employers who just want stuff done and don't care how.
In that context, all these unfortunate layers of complexity at least mean more billable hours.
comment 1y ago · link · parent
In my experience, burnout is really just a subconscious realization that what you're doing is just not worth doing, even for large amounts of money, and it manifests itself in fatigue or pain, because your mind is trying to stop you.
comment 1y ago · link · parent
When Pico 8 came out, I immediately had a feeling of recognition and familiarity: "Oh! So this is the app I was half dreaming of making all these years!*
The app I'm making now gives me the exact same feeling, which is already a reward in itself, but it also means it'll probably give others that feeling too. So it's doubly exciting.
comment 1y ago · link · parent
One additional point this article doesn't mention is that 1 john 1:4 also uses "we" in the same way the article claims Hebrews does. Seeing as St. John the Apostle was clearly united with the Holy Spirit as Revelation shows, and as Mary lived with John, this further strengthens the theory that "we" means "the author and the Holy Spirit who the author was conscious was co-authoring the letter".
[1] https://www.immaculatalibrary.com/articles/2025-03-06-mary-w...
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
In fact, that's how language works. Whatever emerges from organic use is correct language. We the people decide what proper English is, collectively, not a prestigious university or renowned scholar or classic textbook.
comment 1y ago · link · parent
comment 1y ago · link · parent
I used to think my youthful energy was gone forever. Then about 3 months ago I had an idea for a project I truly believed in. I was able to write code for 16 hours straight, day after day, for most of the last 3 months. And it's not exhausting, it's rejuvenating. I feel like a young man again, despite my gray hairs! (I was planning on releasing it today actually, but this weekend I had an epiphany that requires a half rewrite for significant gains, which might add another few weeks.)
comment 1y ago · link · parent
621.
Squirrel (Programming Language)(en.wikipedia.org ↗)
10 points · by 90s_dev · 1y ago · discuss
628.
FreeBASIC is a free/open source BASIC compiler for Windows DOS and Linux(freebasic.net ↗)
115 points · by 90s_dev · 1y ago · 45 comments