Записки на манжетах
126 subscribers
6.62K photos
552 videos
123 files
7.81K links
Мысли вслух.


Обратная связь — @ainikolaev.
Download Telegram
Forwarded from HN Best Comments
Re: Why is OAuth still hard in 2023?

Because the documentation is bad. Oauth is really simple:

Lets say you want to use google as an auth provider. You do this:

"Hey google who is this guy? I'm going to send them to google.com/oauth, send them back to example.com/oauth, and in the headers of the request include the word "Authorization: bearer" followed by a bunch of text"

Google says "Oh yeah I know that guy, here I'll send them back to where you said with a token"

Then later on you can take the token and say "Hey google, somebody gave me this token, who is it?"

That's pretty much it. You have to trust that google isn't lying to you, but that's kindof the point of oauth.

But that's never what the documentation says. It's always 10 pages long and the examples are like "here's a fully functioning python web server using flask and function decorators, oh the actual auth flow, which is really like 3 lines of code, is hidden inside of a library".

To people who write documentation: PLEASE for the love of god show me how to talk to your API both using your library, but also using something like urllib2 or requests or something.

Ideally the documentation is the absolute most minimal way of making the service work, and then adds more and more usefulness on top of that. I'm not going to judge you for writing bad code in an example. The example could practically be pseudocode for all I care. I just want to see generally how your API is supposed to work.

edit: yes, auth0, I am looking at you.

thepasswordis, 2 hours ago
Forwarded from HN Best Comments
Re: Linen.dev: A 500 kb Slack alternative

Not enough discussion here of the parts under "Our Optimization Strategies", which was the most interesting to me. Assorted reactions:

> We found that react-icons had an issue that lead to everything being imported. This meant that we were including every single react-icon in our package whether we need it or not.

Kudos to the Linen team for proactively finding this - I have a feeling tons of projects blindly trust that tree-shaking their dependencies will "just work" even though for many libraries it won't!

> We also noticed that we were only using AWS client for s3 upload on the client side and it was taking up significantly more bundle size we need so we replaced the entire client side package with a 2 api calls to the AWS api.

For such a minimal use case, this feels like a logical choice even if it's slightly more work to implement.

> We ended up moving the code highlight code to a backend api that would cache the results.

Love seeing websites make smart choices about which work to handle in the server versus the client.

thex10, 8 hours ago
Forwarded from Enjoy the Decline
Media is too big
VIEW IN TELEGRAM
𝐄 𝐍 𝐉 𝐎 𝐘 | 𝐓 𝐇 𝐄 | 𝐃 𝐄 𝐂 𝐋 𝐈 𝐍 𝐄
@EnjoyTheD
Forwarded from HN Best Comments
Re: Ask HN: Most interesting tech you built for just y...

I have a rail line right under my apartment, so I built a small computer vision app running on a Rasperry Pi which records each train passing, and tries to stitch an image of it.

It has a frontend at https://trains.jo-m.ch/.

Edit: it's currently raining and the rain drops are disturbing the images a bit.

jo-m, 3 hours ago
Forwarded from HN Best Comments
Re: Every web search result in Brave Search is now ser...

How is it that Brave managed to build an indexer and remove dependence on Bing in less than two years but DuckDuckGo hasn't been able to do it in a decade.

IceWreck, 21 hours ago
Forwarded from HN Best Comments
Re: NASA Power Hack Extends 45-Year Voyager 2 Mission ...

Everything about Voyager is just mind-blowing. These are 45 year old electronic devices, using 70's tech, with zero maintenance, operating 22 light hours away.

At that range they can still send messages detectable on earth. 9 out of 10 instruments are still working. People just leaving school when they launched are already retired.

This is one time when the adage "they don't make them like they used to" is well applied.

Hat tip to all involved.

bruce511, 19 hours ago
Forwarded from HN Best Comments
Re: Check if your IKEA chair is compatible with your s...

I once had the problem that running make with too many parallel jobs (-j) would change my keyboard layout.

The machine was some laptop mainboard glued to the backside of my monitor, and the USB socket came out at the top of the mainboard. On its way down, the USB cable for the keyboard passed across the whole mainboard. On high load, the mainboard created enough interference to cause the connection to reset, re-hotplugging my keyboard, so the previous setxkbmap call was not effective anymore and i was back to the standard US qwerty layout.

blueflow, 2 hours ago
Forwarded from HN Best Comments
Re: Ask HN: Most interesting tech you built for just y...

My grandmother has dementia. About twice a day, she calls my parents every 5 minutes, forgetting that she just hung up. The calls are always the same: "You live there now. Yes you have money. We came to visit you yesterday." This can go on for an hour or so.

My parents are incredibly patient, but after a couple of these calls, they'll just leave the phone to ring. The soundtrack of the phone constantly ringing in the house, and the guilt associated with not picking up, is unbearable.

My brother and I built a system where her calls get re-routed to a rotation of relatives to answer her calls, to spread the load. After a call with her, each person gets a 2 hour break (customizable). If no one is available to answer, or if everyone is on break, she gets a voicemail that my dad recorded that explains that we love her, that she lives there, all the usual stuff.

It's working beautifully.

pigcat, 4 hours ago
Forwarded from Data is data
Высшая алгебра, смысл жизни и ниндзя. Кино смотрится на одном дыхании. Трезвым смотреть с осторожностью.

https://youtu.be/NgNRRI9s7uk
Forwarded from Jovan.ru
Такое наблюдение — прошлое не такое уж и клевое, как ты его помнишь. А настоящее, если подумать, может и не так уж плохо.

Ну а будущее всегда — серьезно, всегда оказывается лучше, чем ты ожидаешь.

Хороших выходных всем! Я больше не буду звучать как коуч.
Forwarded from HN Best Comments
Re: Beautiful branchless binary search

“Those spikes for std::lower_bound are on powers of two, where it is somehow much slower. I looked into it a little bit but can’t come up with an easy explanation. The Clang version has the same spikes even though it compiles to very different assembly.”

I saw this and immediately went “oh, those look like Intel hardware”.

Intel uses 12-bit memory port quick addressing in their hardware, resulting in an issue known as “4K Aliasing”. When addresses are the same modulo 4K, it causes a collision that has to be mitigated by completing the associated prior memory operation to free up the use of the address in the load/store port system, effectively serializing operations and making performance very dependent on the data stride.

I first bumped up against this when running vertical passes of image processing algorithms that got very slow at certain image sizes, a problem that could be avoided by using an oversized buffer and correspondingly oversized per-line “pitch” to diagonally offset aliased addresses (at a small cost to inter-line cache line overlap).

chaboud, 1 day ago
Forwarded from HN Best Comments
Re: Ask HN: Most interesting tech you built for just y...

My townhome complex had one of those call boxes at the front gate. When Doordash/FedEx/the cleaners/the in-laws/etc arrived they would have to call me from the call box and I'd have to answer it and listen to garbled audio to figure out who it was and press 9 to open the gate. It was kind of a pain, so I made a Twilio app to answer calls from the call box.

I set up custom entry codes that I could hand out to anyone. Everyone got their own code, and it would text me whenever someone used a code so I'd instantly know who was coming. The text conversation was my timestamped access log. I also put time constraints on some codes so e.g. Doordash couldn't open the gate in the middle of the night, or I could set up a temporary access code for a party, and I rotated codes too, with text notifications if an outdated code was used.

I thought about making a paid app out of it, but it just didn't seem worthwhile. I didn't expect that many people would want to pay for it. For a while I was excited about a YC startup called Doorport that was going to make a hardware device that you'd install inside those dumb call boxes and make them smart with all sorts of cool features, better than my Twilio hack. But I think they pivoted to a much less interesting pure software thing and then got acquihired.

modeless, 1 day ago
Forwarded from Мир Метро
В этот день в Ленинграде в 1956 году на действующем перегоне была открыта промежуточная станция «Пушкинская».

При проходке наклонного хода станции «Пушкинская» возникли технические сложности – замораживающий контур не дал ожидаемого эффекта, вследствие чего часть сооруженного наклонного тоннеля оказалась затопленной грунтовыми водами. На ликвидацию последствий прорыва плывуна и повторное замораживание потребовалось дополнительное время, поэтому, хоть станция формально и входит в состав участка первой очереди, её открыли на полгода позже - 30 апреля 1956 года.

Подземный зал станции «Пушкинская» очень похож на московскую станцию «Октябрьская», автором проекта которой также был архитектор Л.М. Поляков.

«Пушкинская» - единственная привокзальная станция Петербургского метрополитена, вестибюль которой не встроен в привокзальный комплекс. Для того чтобы попасть на вокзал, необходимо выйти на улицу.

Полностью статью читайте на сайте (очень рекомендуем) :)
http://www.mirmetro.net/spb/01/18_pushkinskaya
Forwarded from HN Best Comments
Re: Just Simply – Stop saying how simple things are in...

Or maybe -- controversial opinion here -- people shouldn't be such babies. I'm looking around the HN discussion here and can't quite believe how personally offended people are by these words.

Yes, at the beginning of the first semester at university, hearing a math professor say a step is "trivial", when it was quite hard, was a bit grating. One month in, I realised that the intended meaning of the word was that no special clever trick was required to make the deduction, just a lot of perseverance.

Similarly, when documentation mentions to "simply" do something, and I don't get it, isn't that a clear hint that I'm still missing a concept somewhere and need to look around for an explanation?

What I wonder is: Why is this so personal? Are people really shamed into quitting their career over a misplaced "simply" in a piece of tech writing because it triggers their impostor syndrome? Is that the reason why tech documentation has slowly been evolving into 50-minute step-by-step YouTube tutorials that start with installing the IDE? What happened to the expectation of people being adults?

codeflo, 7 hours ago
Про таможню: оказывается, данные деклараций выдаются конторе, которая, как обычно, защищает лицензионные права

Поскреби любого защитника интеллектуальных прав — найдёшь чудище о рогах и копытах