Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
emptysea
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
17 ms
·
181.
▲
by
emptysea
6y ago
One thing I've encounter with pytest fixtures is they have a tendency to balloon in size. We started out with like 50 fixtures, but now we have a conftest.py file that has `institution_1`, ..., `institution_10`. My end conclusion is th
182.
▲
by
emptysea
6y ago
In my experience it’s been worth the trouble of writing partial type stubs for your project’s dependencies. And by partial I mean only typing the stuff you end up using, so if you just use one function from some huge, untyped package, just
183.
▲
by
emptysea
6y ago
I run tsc with noEmit passed as a flag. Esbuild is replaces my previous tsc, babel, uglify setup and is much faster.
184.
▲
by
emptysea
6y ago
A nice quality of the `guard` in swift is that you can chain multiple conditions, which is harder to do in rust (maybe with some macros a la if_chain?)
185.
▲
by
emptysea
6y ago
I think your example should instead be: someFunction.toString().charAt(10) == 'a' so you're getting the function's string representation, not its return value Also I've never even considered that minifiers
186.
▲
by
emptysea
6y ago
I think if you settle for the args being combined into a tuple you could essentially create a tagged union and the type checker should be able to refine off the comparison. Type would be something like: Union[Tuple[Literal[“thing1”],
187.
▲
by
emptysea
6y ago
It's been a while since I last ventured into nix with python, but when I last tried it seemed way less user friendly compared to the current python solutions like poetry[1]. With poetry I can `poetry add foo` and `foo` will be added as
188.
▲
by
emptysea
6y ago
A nice advantage of having a TextField with a check constraint, instead of a varchar, is that the locks required in Postgres to change the check constraint are less extreme than the ones required to change the length of varchar. With a chec
189.
▲
by
emptysea
6y ago
Alternatively a Protocol can be used instead of Callable from typing import Protocol class ErrorHandler(Protocol): def __call__(self, p0: int, p1: Exception) -> None: ... def handler(on_error: ErrorHandler): ...
190.
▲
by
emptysea
6y ago
Sounds like your describing what I like to call a fancy build system Something like Bazel[0], Buck[1] Pants[2], etc. One of their main features is robust caching of build artifacts, which is helpful for larger projects. But they require so
191.
▲
by
emptysea
6y ago
Interesting to see more competitors to Heroku popup. Kind of amazing how the big cloud providers still haven't solved this problem. Heroku still has one of the easiest setups of anyone on the market, and they've just been coasting
192.
▲
by
emptysea
6y ago
Have you tried https://jestjs.io/ ? It doesn't have as crazy of chaining like Mocha and has snapshots which I sometimes miss when using pytest.
193.
▲
by
emptysea
6y ago
Whoops! For future internet historians, it should have been: sum(x % 10 == 0 for x in range(1000))
194.
▲
by
emptysea
6y ago
Never seen that before. Neat how the bool being a subclass of int pokes out in various ways. A nice side effect is that bools can used with sum: sum(x % 10 for x in range(1000))
195.
▲
by
emptysea
6y ago
It's a one time fee and IMHO is totally worth it. Sublime Text and Sublime Merge are works off art in terms of speed and usability. Although I tend to use vscode more now for editing, I use Sublime Merge every day at work. Worth every
196.
▲
by
emptysea
6y ago
We have something similar at my current place where every week or two someone presents. It ends up being the same people presenting and I don’t think it is because people are afraid of public speaking, but instead people don’t care about th
197.
▲
by
emptysea
6y ago
Related to HTTP timeouts, I’ve run into database clients without default timeouts. This meant even though the HTTP request was cut off after the timeout, the database request kept on working causing tons of slow database requests to be runn
198.
▲
by
emptysea
6y ago
The downside of using web sockets is they complicate deployment and reliable delivery is more difficult than `/status?since=$pk`
199.
▲
by
emptysea
6y ago
Interesting, we ran into a very similar thing at my current place where we have a CSV importer storing results in mongo. Importantly it also stores the errors that occurred during the import. In our case someone uploaded a _huge_ CSV with s
200.
▲
by
emptysea
6y ago
I’m excited for no event pooling. I’ve been bitten by that a few times when refactoring. Thought about making a lint for it but never got around to it. https://reactjs.org/blog/2020/08/10/react-v17-rc.htm
201.
▲
by
emptysea
6y ago
Seems similar to https://apps.apple.com/us/app/next-meeting/id1017470484?mt=1... which I love and use every day. Allows you to click on the events and open meet, zoom, etc.
202.
▲
by
emptysea
6y ago
If I understand correctly you want "new types" in typescript, which can be done either via a library or by hand rolling it: - https://github.com/gcanti/newtype-ts - https://github.com/Microsof
203.
▲
by
emptysea
6y ago
Our UI at work is using typescript so these assertions aren't as important as they were in plain JS days. However runtime types like io-ts are important in network calls since the HTTP client's return type is `unknown`.
204.
▲
by
emptysea
6y ago
Similar story at my place. New executive hired who loves OKRs. Ends up not changing anything because the engineering OKR is “work on the product roadmap” aka what we’ve always been doing. Only lasting impact is there are a few more slides i
205.
▲
by
emptysea
6y ago
Generics are supported via `@template` https://www.typescriptlang.org/docs/handbook/type-checking-j... types can be imported either explicitly via `require()` or via the `@type {import("foo").Bar}` Ther
206.
▲
by
emptysea
6y ago
typescript also supports type checking js code: https://www.typescriptlang.org/docs/handbook/type-checking-j... I've found this very useful for gradually migrating a node.js project to a more maintainable sta
207.
▲
by
emptysea
6y ago
just a heads up, casting `as string` isn't safe since the request param could turn out to be an array. If the request ends up with the query param as an array, there isn't a runtime to validate the cast and now the variable is typ
208.
▲
by
emptysea
6y ago
Anecdote: at my current org the ideal we talk about is having a component library designed in Figma by the Designers and implemented by the engineers. In reality Design doesn't use components and most pages end up being composed of a b
209.
▲
by
emptysea
6y ago
Couldn’t threads handle that use case?
210.
▲
by
emptysea
6y ago
lanes.io has a firebase error for me on Safari 13.1 > FirebaseError: Messaging: This browser doesn't support the API's required to use the firebase SDK. (messaging/unsupported-browser).
More ›