Hacker Newsnew | past | comments | ask | show | jobs | submit | knubie's favoriteslogin

I'm not sure if that's already exposed as an option, but if you're happy to run this app locally, then LiteLlm exposes local models using the OpenAI API. That means you only need to change the endpoint, tell LiteLlm to use for example Mistral and it should "just work". Even if not implemented yet, it would be a trivial change.

You don't really need all that stuff. Sanitization is straight forward to implement and only required for user generated strings (since you want to make it HTML-safe). It could be argued that automatically sanitizing everything including already safe data types like numbers and system-generated content adds an unnecessary performance overhead for certain projects.

As for events, binding is really very easy to do and it's already localised to the component so managing them is trivial.

Loops are also trivial; you can simply use Array.prototype.map function to return a bunch of strings which you can incorporate directly into the main component's template string. In any case, you can always use the native document.createElement and appendChild functions to create elements within the component and add them to its DOM or shadow DOM.

I've built some complex apps with plain HTMLElement as a base class for all my components and found is much simpler than React without any unexpected weirdness and using fewer abstract technical concepts. Code was much more readable and maintainable. I didn't even need a bundler thanks to modern async and defer attributes of script tags among others.

I think the reason why people are using React still is just marketing, hype and inertia. The job market which is gatekept by non-technical recruiters demands React. It's all non-tech people making the big decisions based on buzzwords that they don't understand.


"lunzi" and "huidu" are both nice concise terms, would be nice to have an terse english equivalent. I am curious if knowing this sort of term is actually helpful for the average engineer working at an org like bytedance, or if things are siloed to the point that the eng orgs are basically separate with limited Chinese-English collaboration outside of certain management teams.

PS: If you're interested in learning more Chinese tech terms, I've put together an Anki deck of 330+ cards with example sentences.

Anki deck: https://ankiweb.net/shared/info/1351796314

Preview of cards + list of sources: https://computerlab.io/2023/06/08/chinese-software-engineeri...


Anything CRDT (conflict free replicated datatypes: https://en.wikipedia.org/wiki/Conflict-free_replicated_data_...) related is fun to read up on and play with.

Papers and references (page maintained by central academic in the world of CRDTs): https://crdt.tech

Group doing research into how they can be used to build interesting collaborative (and async) applications: https://www.inkandswitch.com

A few of the major open source implementations - mostly for rich text editing or JSON like data structures:

- Yjs: https://github.com/yjs/yjs

- Automerge: https://github.com/automerge/automerge

- Peritext: https://www.inkandswitch.com/peritext/

- Dimond types: https://github.com/josephg/diamond-types

People building eventually consistent database syncing with them:

- https://electric-sql.com (Postgres <-> SQLite)

- https://vlcn.io (SQLite <-> SQLite)

Open source colaborative servers (coordination, persistance, presence):

- https://github.com/ueberdosis/hocuspocus

- https://github.com/partykit/partykit

- https://github.com/firesync-org/firesync


I felt obliged to comment because I feel I know what you are talking about and I also worry that much of the advice posted so far is wrong at best, dangerous at worst.

I am 42-year-old very successful programmer who has been through a lot of situations in my career so far, many of them highly demotivating. And the best advice I have for you is to get out of what you are doing. Really. Even though you state that you are not in a position to do that, you really are. It is okay. You are free. Okay, you are helping your boyfriend's startup but what is the appropriate cost for this? Would he have you do it if he knew it was crushing your soul?

I don't use the phrase "crushing your soul" lightly. When it happens slowly, as it does in these cases, it is hard to see the scale of what is happening. But this is a very serious situation and if left unchecked it may damage the potential for you to do good work for the rest of your life. Reasons:

* The commenters who are warning about burnout are right. Burnout is a very serious situation. If you burn yourself out hard, it will be difficult to be effective at any future job you go to, even if it is ostensibly a wonderful job. Treat burnout like a physical injury. I burned myself out once and it took at least 12 years to regain full productivity. Don't do it.

* More broadly, the best and most creative work comes from a root of joy and excitement. If you lose your ability to feel joy and excitement about programming-related things, you'll be unable to do the best work. That this issue is separate from and parallel to burnout! If you are burned out, you might still be able to feel the joy and excitement briefly at the start of a project/idea, but they will fade quickly as the reality of day-to-day work sets in. Alternatively, if you are not burned out but also do not have a sense of wonder, it is likely you will never get yourself started on the good work.

* The earlier in your career it is now, the more important this time is for your development. Programmers learn by doing. If you put yourself into an environment where you are constantly challenged and are working at the top threshold of your ability, then after a few years have gone by, your skills will have increased tremendously. It is like going to intensively learn kung fu for a few years, or going into Navy SEAL training or something. But this isn't just a one-time constant increase. The faster you get things done, and the more thorough and error-free they are, the more ideas you can execute on, which means you will learn faster in the future too. Over the long term, programming skill is like compound interest. More now means a LOT more later. Less now means a LOT less later.

So if you are putting yourself into a position that is not really challenging, that is a bummer day in and day out, and you get things done slowly, you aren't just having a slow time now. You are bringing down that compound interest curve for the rest of your career. It is a serious problem.

If I could go back to my early career I would mercilessly cut out all the shitty jobs I did (and there were many of them).

One more thing, about personal identity. Early on as a programmer, I was often in situations like you describe. I didn't like what I was doing, I thought the management was dumb, I just didn't think my work was very important. I would be very depressed on projects, make slow progress, at times get into a mode where I was much of the time pretending progress simply because I could not bring myself to do the work. I just didn't have the spirit to do it. (I know many people here know what I am talking about.) Over time I got depressed about this: Do I have a terrible work ethic? Am I really just a bad programmer? A bad person? But these questions were not so verbalized or intellectualized, they were just more like an ambient malaise and a disappointment in where life was going.

What I learned, later on, is that I do not at all have a bad work ethic and I am not a bad person. In fact I am quite fierce and get huge amounts of good work done, when I believe that what I am doing is important. It turns out that, for me, to capture this feeling of importance, I had to work on my own projects (and even then it took a long time to find the ideas that really moved me). But once I found this, it basically turned me into a different person. If this is how it works for you, the difference between these two modes of life is HUGE.

Okay, this has been long and rambling. I'll cut it off here. Good luck.


Has anyone tried this for a free ngrok alternative that works with HTTPS, doesn't require setting up a server and has no rate limit within reason? https://developers.cloudflare.com/pages/how-to/preview-with-...

Based on the page it looks like you can install Cloudflare's CLI and then run `cloudflared tunnel --url http://localhost:3000`, and you'll get back a URL to visit such as https://seasonal-deck-organisms-sf.trycloudflare.com. Looks like it supports being able to associate it with a custom domain too so you can have repeatable URLs.


Does anyone have any advice on how to be successful with ledger? I've tried a few things. I entered a lot of things, but the issues I have are more structural nature and probably general lack of accounting experience:

What types do you use is there a useful list, that I can then translate to SMB or Personal tax filing? A somewhat standardized structure of assets, liabilities, accounts payable, accounts receivable etc.

How do you deal with Cash? (EDIT: most answers assume that you only spend little cash, but in some countries cash can account for a decent amount of your income)

How do you deal with interest?

How do you keep your bank statements? I've tried using https://github.com/johannesgerer/buchhaltung which supports paypal ofx and hbci

How do you convert your balance sheet into a tax filing compatible format?

How do you track things like rent? Do you keep it as a recurring entry i.e. `~ Monthly` or do you only book it when you pay with buchhaltung?

Do you keep completely separate ledger files if you're sole proprietor or can you keep them semi separate and work with includes to create separate reports for private and sole proprietor tax filing?

How do you track small expenses on the go? There's a web app called fava from beancount which looks nice, but i'm not sure you want to expose it to the outside world and i'm not sure the files are fully compatible with hledger https://beancount.github.io/fava/

Any help would be greatly appreciated.


I'm not sure I'm the best person to ask about this as I was very naive at that point in my journey. Launching Preceden was literally posting on HackerNews and hoping for the best.

I would encourage you to join Microconf Connect, a Slack community of software entrepreneurs, where topics like this are discussed often: https://microconf.com/connect. Many of the old Microconf conference presentations are also on YouTube: https://www.youtube.com/c/MicroConf


From this operations engineer's perspective, there are only 3 main things that bring a site down: new code, disk space, and 'outages'. If you don't push new code, your apps will be pretty stable. If you don't run out of disk space, your apps will keep running. And if your network/power/etc doesn't mysteriously disappear, your apps will keep running. And running, and running, and running.

The biggest thing that brings down a site is changes. Typically code changes, but also schema/data changes, infra/network/config changes, etc. As long as nothing changes, and you don't run out of disk space (from logs for example), things stay working pretty much just fine. The trick is to design it to be as immutable and simple as possible.

There are other things that can bring a site down, like security issues, or bugs triggered by unusual states, too much traffic, etc. But generally speaking those things are rare and don't bring down an entire site.

The last thing off the top of my head that will absolutely bring a site down over time, is expired certs. If, for any reason at all, a cert fails to be regenerated (say, your etcd certs, or some weird one-off tool underpinning everything that somebody has to remember to regen every 360 days), they will expire, and it will be a very fun day at the office. Over a long enough period of time, your web server's TLS version will be obsoleted in new browser versions, and nobody will be able to load it.


Few people live in what can reasonably called a "community" any more, so the link between anonymous theft and the erosion of social culture doesn't make sense to everyone.

The most remote, homestead-y places will have unattended "stores" where you leave out goods and people come by and leave money in the basket and take what you have. The least remote, most-managed places have security locks on items over $15. It is impossible to run a friendly, neighborhood-run store when any new customer is a potential thief. When theft goes uncontrolled, owners begin to look at their customers with suspicion. Those who don't like theft leave for more peaceful places and are replaced by owners who will tolerate theft with a big insurance policy and force.

It is continually astonishing to me that so many "community-focused" people don't realize that unilateral actions of harm inside the community (theft, assault, etc.) have ripple effects that harm the entire community. If you grow up in a region where store owners believe you might be a thief unless they personally know you and you have to constantly worry about protecting what's yours, and I grow up in an area where I'm trusted and respected by business owners and I leave my door unlocked when I go to town, how is equity meaningfully achievable between us?


When I am hacking something relatively simple together, I tend to do:

echo '' | fzf --preview 'jq {q} < filename.json'

This approach can be generalized to other tools, to some extent: https://github.com/pawelduda/fzf-live-repl


I’m working on making body doubling a more main stream approach to accomplishing everyday tasks.

Body doubling is known within the ADHD community and entails performing a task in the presence of another. More details here: https://www.healthline.com/health/adhd/body-double-adhd

It helps to engage motivation by using another person as the proxy. I wrote a bit about how I think it works here: https://doubleapp.xyz/blog/body-doubling-proxy

The technique goes way beyond just ADHD applications for executive functions and is something we tend to do anyways, e.g., running with a friend, studying in a group, etc.

It solves an issue for myself and I truly want to help others with the approach by making a way to stay accountable through the help of others.


That assertion doesn’t pass the smell test. Americans are among the most highly educated people in the world. And significantly more educated than folks in most European countries, and significantly more educated than Americans of previous generations.

I’ve got an engineering undergraduate degree and a law degree, and when I saw that ad, I remembered the 2020 Democratic debate where nearly everyone raised their hand to decriminalizing border crossings and free healthcare for illegal aliens.

You can split hairs and say that Biden didn’t raise his hand, and he’s the President, not Elizabeth Warren. But the ad doesn’t depend on folks being “uneducated.” It merely requires them to make some uncharitable inferences about how much influence the supporters of those other candidates have over Biden. In my opinion it’s a legal tackle.

As to people being “screwed over” they’re not. Noah Smith, a liberal, has done quite a good job showing how most Americans are better off than their European counterparts, except folks at the very bottom: https://noahpinion.substack.com/p/americans-are-generally-ri...

> but again this is just one more data point showing that the typical American enjoys a higher material standard of living than the typical European.

> A person at the cutoff of the bottom 10% in the U.S. takes home only $11,287 per year, while their counterpart in Denmark takes home $15,607.

Instead of assuming that people are just uneducated and irrational, maybe educate yourself and understand what dynamics are really at play. The median American is choosing greater consumption capacity at the expense of safety nets for those at the bottom. That’s arguably selfish, but not irrational.


Given some of the people here might run their own servers, the self-hosted alternative is to have something like Sonarr PVR for newsgroups and torrents, alongside a tracker indexer like Jackett, and then Plex for the frontend. In this combination, you "subscribe" to TV shows and select movies on the Sonarr system, and then the downloading is taken care for you even when new episodes arrive. These will then appear on Plex which is refreshed by the pipeline automatically. The system integrates with private trackers and is capable of maintaining your seed-ratio if that's important.

I recently fell into this rabbit-hole while trying to organise my music. For music there is Lidarr, which also ID3 tags your music and reorganizes it into folder structures. This is convenient since organizing anything using Plex is a nightmare.


I'm a sucker for good little microinteractions. The author's checkbox may not be one of those, as it seems a bit overdone, but I'd have to try it to be sure. It's easy to go too far.

But, some other examples that I love:

https://www.joshwcomeau.com/animation/3d-button The red "push me" button is great, but also check out the sun/moon icon near the top right!

https://www.jam3.com/#contact The hover states on the buttons.

https://citymapper.com The top-left hamburger icon.

(I also happen to be quite proud of the hover states on my own site: https://jonathanalland.com/)

Making this type of stuff is definitely what I miss most about working in web design.


See Labdoor.com and Consumerlab.com to verify supplement quality.

There are some good meta studies on Omega-3s. Dr Bradley Stanfield[1] walks through Mayo Clinic meta analysis[2]. Rhonda Patrick[3] is the best resource for an interpretation of the data.

TLDR; consume enough omega-3s (DHA/EPA) to get omega-3 index above 8.0. Discrepancies in research outcomes are attributed to study design, methodology of measuring intake, methodology of measuring blood.

[1] https://www.youtube.com/watch?v=58RkZy6FEco&ab_channel=DrBra... [2] https://www.mayoclinicproceedings.org/article/S0025-6196(20)... [3] https://www.youtube.com/watch?v=XcvhERcZpWw&t=2108s


Having not touched this since early days of TPB, is there a decent overview to approaches in 2022 you could point me to? E.g. has torrenting moved to the cloud or are most running vpns? Asking for a friend.

FYI: Alternatives include: Cash App Taxes https://cash.app/taxes and FreeTaxUSA https://www.freetaxusa.com/

I had started my taxes this year with TurboTax, but it wasn't loading some of my investments automatically, which was one of the big plusses it brought to the table.

One minus reported by HN users on a thread yesterday is that CashApp Taxes require you to install their app to login, you login by scanning a QR code on your phone and the app logs you in.

Last night I started with CashApp Taxes, and it looks pretty good. Other reviewers here yesterday were saying they had done both and preferred FreeTaxUSA, so I was going to get started over there and see which one I liked best.


Video game music is actually designed to increase your ability to concentrate on the game. I highly recommend listening to some as you're coding. You can get it at Bandcamp [1,2]. Trance music also works, especially Goa Trance.

Binaural beats [3,4] are also worth a try.

[1] https://bandcamp.com/tag/video-game

[2] https://bandcamp.com/tag/video-game-music

[3] https://en.wikipedia.org/wiki/Beat_(acoustics)#Binaural_beat...

[4] http://gnaural.sourceforge.net/


I tried to build StackOverflow for flashcards (i.e. spaced repetition with collaboration as a first class feature.) After working on it on nights/weekends for ~2 years, I realized my architecture was shit. I started out with Blazor + F# + PostGres, but eventually I realized that syncing offline client DBs to the cloud was a very nontrivial problem. So I moved to event sourcing. Turns out that's not much better - I started to write my own IndexedDB wrapper, then said "you're a moron" and switched to CouchDb/PouchDb/RxDB. I also wanted to support plugins. I thought I figured that out with Blazor, but eventually I realized that more powerful plugins would want to manipulate the DOM directly. Blazor's virtual DOM kills that possibility. So, I'm off the dotnet ecosystem (I am so, so sad to leave F#) and onto Typescript + SolidJS. I would've gone ReScript but that's tightly coupled to React which uses the VDom. Perhaps I should be using Svelte - I'm not 100% on any of this new architecture yet. So my project has not yet entirely failed... I just realized I spent ~2 years on the wrong architecture.

The carcass of my attempt in dotnet: https://github.com/dharmaturtle/cardoverflow


The US can change their tax system, if they want to.

Eg they could tax land value. It's very hard to move land out of the country or hide it. https://en.wikipedia.org/wiki/Land_value_tax

Or they could tax sales / consumption instead of trying to tax company profits.

Company profits are just a bit too nebulous to tax properly.

Eg you can reduce your profits just fine by shifting your capital structure from being financed by equity to being financed largely by debt. (And as we all know, too much leverage is not all that great for the resilience of the economy.) That doesn't even need any Hollywood accounting, it's very orthodox accounting.

Yet, we keep pushing companies in that direction with the incentives that most tax systems around the world set.


Ignore averages. They are often deceptive, and here as well. Most places in the US have zero gangs, and many places have zero murders.

The question is: why are murders so out of control in certain areas? And the answer is: local policing and local politics. DAs don't prosecute, and so police won't risk their life to bring people in. They show up 30 minutes later as the clean up crew.

So it's actually fairly normal for repeat offenses here because someone is never arrested, never charged, out on bail, plead down to a slap on the wrist, or out on parole where supervision is a joke.

Why are local politics so screwed up? That's an interesting question. One aspect is one-party rule: the Democrats are such an overwhelming majority in a lot of these inner cities that all the politics happen before the ballot is ever printed. Within the Democratic party, there's a dangerous contingent that simply doesn't want to imprison criminals for reasons I don't entirely understand.

Why do the people in such cities put up with such a bad system? Because even within those cities, the problem areas are contained, and can be safely ignored (sadly). "Root causes" sounds nicer than "lock 'em up", so most of the people in the city nod along and go about their business, and avoid the bad parts of town.

My guess is that Ukrainians just don't have time for that kind of nonsense. If someone is violent, they are put away quickly. The idea of making a deal with a violent criminal is probably not fashionable there. There are lots of poor people in Ukraine, and mostly the same skin color, so nobody puts up with the "violence is just a symptom of poverty and capitalism and racism and ten other problems that must be solved first". A few civil liberties probably get stomped along the way, which also helps bring crime down to low levels; but I don't think giving up civil liberties is a prerequisite of law and order.


My main technique from my engineering undergrad days was extremely effective and yet very simple and easy to describe and/or implement. It is:

1. Attend the lectures and take good notes. Don't write things down that are obvious or that you already know.

2. Before any exam, go back over the dozens of pages of notes and condense them down to 3 or 4 pages, omitting details that will be brought to mind by the things you are writing down.

3. Go back over the 3 to 4 pages, condensing them down to a single page, compactly written.

4. Go back over the single page, condensing it down to a single notecard.

The act of condensing requires you to internalize the knowledge enough to know what you have memorized and what you must still note down. And the act of repeatedly writing down the hard parts commits those to memory too.

By the end, the notecard has a handful of difficult to remember formulas and a bunch of keywords that prompt your memory to recall the salient details. In the US at that time, a single notecard was often allowed during exams, so the final work product was also that card.

(My recall 20 years later is excellent, so this is not cramming.)


Stuff like this is neat but always feels a bit like a short-term bandaid.

I'd encourage folks here to check out programs like Egoscue, Alexander Technique, Gokhale method, etc for a more 'holistic' (quotes cuz its such a vague buzzword in health/wellness).

I'm halfway thru Egoscue and it's been amazing for beginning to restore my mobility from when I was a kid, but people should do their own research.


This is unsurprising. Take a step back and squint enough and you can see any wide-scale fiscal stimulus will be absorbed by land rent. This is the inverse of the Georgist observation that "all taxes come out of rent." All stimulus is absorbed by rent.

Winston Churchill on the topic: http://www.andywightman.com/docs/churchill.pdf

> Some years ago in London there was a toll bar on a bridge across the Thames, and all the working people who lived on the south side of the river had to pay a daily toll of one penny for going and returning from their work. The spectacle of these poor people thus mulcted of so large a proportion of their earnings offended the public conscience, and agitation was set on foot, municipal authorities were roused, and at the cost of the taxpayers, the bridge was freed and the toll removed. All those people who used the bridge were saved sixpence a week, but within a very short time rents on the south side of the river were found to have risen about sixpence a week, or the amount of the toll which had been remitted!

> And a friend of mine was telling me the other day that, in the parish of Southwark, about 350 pounds a year was given away in doles of bread by charitable people in connection with one of the churches. As a consequence of this charity, the competition for small houses and single-room tenements is so great that rents are considerably higher in the parish!

> All goes back to the land, and the land owner is able to absorb to himself a share of almost every public and every private benefit


PWA are explicitly exempt from the data storage wipe behavior[1]. So there's that, at least. For now.

Although I agree that it's a fairly minor win in the grand scheme of how handicapped PWA's are on iOS. And like you said, the lack of install prompts and tucking away the PWA "installation" option in the share menu makes it less than intuitive and requires manual awareness efforts by devs[2].

[1] Last section of https://webkit.org/tracking-prevention/

[2] https://michaellisboa.com/blog/prompt-ios


What worked for me is trying to develop my own kernel. This might be too low-level for you, but it helps immensely to dispel the magic around how code gets executed by the CPU and the OS. You'll learn how the OS achieves protection from user programs, what are interrupts and how does the OS handle them, what are processes and threads and how does the OS schedule their execution, how virtual memory works (segmentation/paging), how the program is laid out in memory (code, data, heap, stack), how runtimes like the C runtime manages memory and links your code to OS syscalls, how dynamic linking works, what is an ABI, what is a calling convention, how does the compiler, the linker, and the OS know what each should do? How memory mapped file access works, etc. I can keep going, but you get the picture.

From there, you'll know where to go next based on what you've learned so far.

My recommended reading list is:

[1] Operating Systems: Three Easy Pieces https://pages.cs.wisc.edu/~remzi/OSTEP

[2] Intel Software Developer Manuals (especially volume 1 and 3A) https://software.intel.com/content/www/us/en/develop/article...

[3] OSDev wiki https://wiki.osdev.org


Use an RSS reader. You will like the lack of feeling of being forced to comment on things you don't care much about in retrospection. No tracking or ads, only content. You can filter shady sites or posts from appearing.

Here are some readers.

0] https://github.com/GetStream/Winds

1] https://github.com/FreshRSS/FreshRSS

2] https://github.com/feedbin/feedbin

3] https://github.com/yang991178/fluent-reader

If you like something closed source, try feedly.

Reddit provides rss for now. For sources that don't, you can use rss.app or similar.

https://www.reddit.com/wiki/rss

One more useful thing some readers provide is an email address that you can use for subscribing to newsletters.


Someone with a full-time job making $10 an hour (1) makes about the same minimum wage as France; (2) is either eligible for Medicaid or pays $67/month for healthcare through an ACA exchange; (3) pays almost nothing in taxes. It’s definitely a livable salary for a young person in a low cost of living area. (Half of people who make under $10 an hour are 18-30.)

Where I live, an hour outside DC and maybe 30 minutes to Baltimore, you can get a 2BR apartment in a nice new building for $1,000 per month. Share that with someone, and a person making $1,500 is spending the recommended 1/3 on rent. $67/month for healthcare on an ACA silver plan, and that leaves $900/month, which is totally doable for a single person, or better yet each half of a young married couple. And frankly, around here you’d get $15/hour just working checkout. In places that have a significant number of $10/hour jobs, rent is something you spend a few hundred a month on. You can eat at a sit down place for under $10.


I'm not an accountant or tax lawyer, so this isn't advise, only my back of the envelope calculation, not even using things like the 172 deduction, or business expenses, but my estimate was actually way off almost double.

Gross Income: $112k

- SEP IRA 25%: -$28k

- Owner Health Insurance: -$15k

- 199-A Deduction (20%): -$12k

Total business income for taxes: $47k

- Married Filing Jointly Deduction: -$24k

- Total taxable income: $23k

Tax on $23k (10% of first $20k, 12% of next $3k): $2360


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: