1,107 karma · joined Mar 22, 2019 (7y ago) · 450 submissions
comment 6y ago · link · parent
Secondly, there are no public transports, so it is unusable in Tokyo.
comment 6y ago · link · parent
My case was about the allow-scripts directive of the sandboxed iframe, which I thought was linked to the csp mechanism, but now that I checked the documentation, it seems that I was wrong.
I basically display a random HTML document in an sandboxed iframe with disabled scripts. When you do so on Chrome and Firefox, the event listeners injected inside the iframe from a script in the parent frame still works, but on Safari it does not because all the scripts (or events) inside the iframe are disabled.
So rather that relying on this mechanism, I used DOMPurify to filter all the scripts.
comment 6y ago · link · parent
https://github.com/phpmyadmin/website/pulls?q=is%3Apr+is%3Aclosed+label%3Aspam
The changes are not even positive contributions, it literally breaks the documentations and adds some useless or unwanted meaningless SPAM.comment 6y ago · link · parent
You can set-up a lot of things and even have a load-balancer. I was also impressed by the smooth and easy onboarding process.
Unfortunately, after starting to use it I realized that my site was extremely slow for everything that is not cached. Cloudflare was adding 250ms of latency to every request to my server. I certainly did not expect that much. When you try to send a support ticket, they aggressively try to make you not do it. My support ticket did not receive an answer for 2 months.
I stopped using it last week and will certainly not look back.
comment 6y ago · link · parent
Some companies who did feel strict during the interviews actually were really good companies.
The opposite is true, I interviewed a company that seemed open minded and fun.
The interview in appearance was quite enjoyable, but with huge red flags. The CTO was always talking (super fast) and just wouldn't let me speak. I could ask only one question (during 1h) and was rudely interrupted in the end because he had no more time.
The CTO also said something like "If you join this company you will work with very competent engineers, smarter than you". To which I humorously answered while defending my pride, but probably ended up looking like someone full of himself.
Clearly this is not someone I would enjoy working with on a daily basis.
comment 6y ago · link · parent
If you can try-catch the failure in the external service, you can rollback the transaction with kiss-orm. Actually kiss-orm does not abstract the transaction itself, so you can do whatever you want.
I just realized a flaw in my current implementation, which is that directly using the repository CRUD methods from inside the sequence (rather than a query) function would execute those operations outside the scope of the sequence.
comment 6y ago · link · parent
I did not know about Ecto. It is interesting, but I think more abstract than what I would like kiss-orm to become.
About the ChangeSet stuff, from what I understood it is actually already possible in kiss-orm. The main difference being that I decided to not do the validation at runtime, but rely on typescript.
At worst you could have a runtime SQL error (inserting the wrong type of data in the wrong column for example), but the queries would be safe from injection.
You can definitely keep using kiss-orm with the default `any` type for the insert and update operation, but you can also specify it: https://github.com/Seb-C/kiss-orm#advanced-typings This way, your typings have to be right to use those methods. Runtime validation of inputs should not be done in the repository/database/orm layer anyway :) .
comment 6y ago · link · parent
Depending on the ORMs, the definition of eager-loading also varies.
I have seem ORMs doing everything in a single query, returning everything in a single result-set and then de-duplicating everything client-side. This is very messy (and impossible to hack/fix most of the time).
Currently, the way to go would be something like this:
const articles = await articlesRepository.search(sql`
"authorId" IN (${sqlJoin(
users.map(user => user.id),
sql`, `,
)})
`);
// Dispatch and assign the articles in the collection of users
I could consider having a helper method to make this easier, but I am afraid this would be quite difficult to use.comment 6y ago · link · parent
I am not sure about what do you mean here?
> dealing with casing (snake_case to camelCase)
This is one of the opinionated parts of kiss-orm I guess, because I specifically do not want to implement this.
I think having consistency in the naming of the properties/columns is more important. I would rather break the naming convention by having snake_case properties than automagically rename properties.
comment 6y ago · link · parent
For example, if your schema is automatically handled, how do you both rename and change the type of a column without losing data? Would it perform a delete and a create?
comment 6y ago · link · parent
As you say, one of the main arguments for query-builders is allowing the support of different RDBMS. But in my experience it not only never happens, but the abstraction is never perfect and makes any unsupported edge case impossible to solve without hacking around.
There is so much that can be done with SQL that would result in a mess of inefficient spaghetti code...
comment 6y ago · link · parent
The repository class that I provide is a very basic and handy abstraction for the 4 basic CRUD operations, but ultimately the goal is to write your own queries and repositories.
comment 6y ago · link · parent
As for the audit fields, I decided not to include it because it very simple to implement, and would be clearer to do it specifically. Most of those fields could be implemented by just adding a default value in the right function.
comment 6y ago · link · parent
IMHO, "real production features" means also caring about the long term maintenance, performance and reliability of the data.
My experience with ORMs (especially ActiveRecord patterns) is that it always becomes a mess once you reach a certain level of complexity. It is very fast to get started, but gets slower over time once you start having a lot of bugs and hard-to-solve behaviours.
comment 6y ago · link · parent
When designing a new project, I have been trying to find a more satisfying design while avoiding the existing ORMs. I especially wanted to use proper SQL rather than reducing it's syntax to fit it in another language.
This is the result of my experiments. This is a completely new balance between productivity, simplicity and readability, while providing useful features.
I use the template-string tagging syntax to allow writing and concatenating raw SQL queries, while keeping it safe from injections, which allowed me to build kiss-orm. There is no query-building involved, you can freely use the full-power of SQL.
I would appreciate feedback on this (and contributions if you love it :D ).
383.
Show HN: ORM for TypeScript with no query-builder, supporting full SQL queries(github.com ↗)
220 points · by Seb-C · 6y ago · 119 comments
comment 6y ago · link · parent
Everything works as expected, there is a lot of storage space and end-to-end encryption. There are clients for all platforms and it just works.
I can easily create secure share links whenever I want.
The only downsides are that the browser-based app is very slow to start once you have lots of files, and the android client does not have the same synchronization capabilities.
comment 6y ago · link · parent
When I also started to build scripts and destroyed his own website, he basically realized the harm he was doing, apologized and stopped.
Reminds me of the old good times when you could trap script-kiddies on msn.
"I think you are lying and not capable of hacking my computer. I'm waiting for you, my IP is 127.42.196.8"
comment 6y ago · link · parent
And because the new service crashes when you input a non-integer string, please catch and ignore the exception client side (we'll fix it later).
comment 6y ago · link · parent
I recommend writing a CustomException class instead. So everytime you see a third-party error, catch it and throw a new CustomException() (Without arguments, otherwise you may carry some bad third-party classes/exceptions in your codebase). And don't forget to catch CustomException at strategic places too, so you can actually throw a new CustomException().
comment 6y ago · link · parent
Well, actually I didn't do anything because you literally have nothing to do. You just have the right to do some business on your own (but of course there are official companies of you want to get bigger).
Just when you start getting money, you have to inform the tax office, so they can give you the form next year.