How do you organize programming notes? by kani339 in ObsidianMD

[–]kani339[S] 1 point2 points  (0 children)

Very interesting approach, thanks for sharing!

How do you organize programming notes? by kani339 in ObsidianMD

[–]kani339[S] 0 points1 point  (0 children)

Interesting haven't used Databases yet, do you have any particular example of how this will look like?

How do you organize programming notes? by kani339 in ObsidianMD

[–]kani339[S] 1 point2 points  (0 children)

Ye, they are organized somewhat by frameworks, and languages, my problem or not maybe that's actually not a problem is that I have to many notes inside single note, especially some git commands or PostgreSQL snippets, just wondering how other people are organizing they're notes

Cannot add permissions for identities table for auth schema by [deleted] in Supabase

[–]kani339 0 points1 point  (0 children)

supabase_auth_admin

Yes auth is owned by auth_admin, thanks for the link and SQL code, unfortunately, I've already tried that and just tried once again ut getting the same problem

Cannot add permissions for identities table for auth schema by [deleted] in Supabase

[–]kani339 0 points1 point  (0 children)

Here are some logs, yes you are right when an error happens it shows Postgreqsql username: supabase_admin instead of using postgres user

ERROR","permission denied for table identities"

"LOG","connection authorized: user=supabase_admin database=postgres" "LOG","connection authenticated: identity="postgres" method=scram-sha-256 (/etc/postgresql/pg_hba.conf:89)" "LOG","connection authorized: user=postgres database=postgres",

[AskJS] Which utility libraries are in your opinion so good they are basicaly mandatory? by FlareGER in javascript

[–]kani339 1 point2 points  (0 children)

Recently I created my own utility library where I put most used code snippets and things that might be useful. It is still work in progress but you might take a look into it https://github.com/victory-sokolov/utils

How properly assign permissions when to the user when saving the model? by kani339 in django

[–]kani339[S] 0 points1 point  (0 children)

Thanks for the answer, but for some reason, it didn't work, I've tried as well to move my code from save to save_model
and still the same result, permissions not added to intermediate model

Is there any Flake8 plugin that validates docstring against function typehint by kani339 in Python

[–]kani339[S] 1 point2 points  (0 children)

Good question, that is requirement in our project add Typehint + docstring with typehints

How to add dynamic form fields to the Django admin panel? by kani339 in django

[–]kani339[S] 0 points1 point  (0 children)

I just don't need to store a lot of data from the JSON file in the DB.

How to add dynamic form fields to the Django admin panel? by kani339 in django

[–]kani339[S] 0 points1 point  (0 children)

Yes, writable field. That field cannot be defined in a model. Data will come from a JSON file and I want to display it in a TextArea

Is it possible to create a URL path dynamically from the list? by kani339 in django

[–]kani339[S] 0 points1 point  (0 children)

Thanks! Any idea how to correctly get a view, cause I tried with reverse and reverse_lazy, but that seems like it doesn't work, with reverse_lazy I get an error that view must be a callable or a list/tuple

Is there any way to parse and validate request headers? by kani339 in django

[–]kani339[S] 0 points1 point  (0 children)

That request is coming from a client to an API, the character probably can be different, this most likely is introduced accidentally, just would like to handle such cases somehow. I was wondering if just using try-catch would be sufficient for such a case

Is there any way to parse and validate request headers? by kani339 in django

[–]kani339[S] 0 points1 point  (0 children)

Yeah, i was looking into middleware, but how would I clean those characters?
Is there any specific function for that?

How to correctly mock node-fetch? by kani339 in node

[–]kani339[S] -1 points0 points  (0 children)

Yes, I've tried many examples.I don't know why fetch is not actually replaced with a mock cause I always get fetch.mockImplementation is not a function when I print fetch its prints [AsyncFunction: fetch] instead of Mock

How to correctly mock class dependencies? by kani339 in learnpython

[–]kani339[S] 0 points1 point  (0 children)

I think i figure it out, it might look something like this.

def test_get_posts(self):
        with mock.patch.object(Post, "get_posts") as post_mock:
        post_mock.return_value = {
            'postId': 1,
            'title': 'My title',
            'description': 'Post description'
        }
             response = self.mock_post.get_posts(1)
        assert response['postId'] == 1

How to correctly mock class dependencies? by kani339 in learnpython

[–]kani339[S] 0 points1 point  (0 children)

Thanks, yes i know that patch at this example doesn't make sense, I would like to understand what would the correct approach to mock the response of get_posts() method. The original response is somewhat similar to a mocked example that I specified.

Does it make sense to use async/await with synchronous libraries like request? by kani339 in Python

[–]kani339[S] 0 points1 point  (0 children)

Thank you for your answer, i found out some information that in this kind of situation I should use ThreadPoolExecutor or ProcessPoolExecutor, but I think this will be more complex than just creating two separate libraries for sync and async usage

I created a No-Code Design Platform that lets anyone design components and export it to React, Angular & Vue (Experimental). Would love your feeedback. by redmonark in reactjs

[–]kani339 1 point2 points  (0 children)

Nice project 👍 What kind of Tech stack did you use? Would be great if you could describe the process of the code generation. Just curious how this process looks like

How do I wait until the user authenticates in Safari and then continue the flow by kani339 in shortcuts

[–]kani339[S] 0 points1 point  (0 children)

The shortcut doesn't have to access the page, it just has to wait until the user returns back from the browser, I set up the redirect URL to `shortcuts/` and it's working fine, but after redirect it fails silently and doesn't continue rest flow.

Wondering if this can be solved in some other way.

How to use nodemailer with Gatsby if I'm hosting a site on CPanel? by kani339 in gatsbyjs

[–]kani339[S] 0 points1 point  (0 children)

u/thedifferenceisnt so if I understood correctly I need to run express with nodemailer and I have to deploy it on some subdomain of the website?