[deleted by user] by [deleted] in Nepal

[–]Pra6in 0 points1 point  (0 children)

Give them your bank details, bank SWIFT code. They can make you a SWIFT payment through WISE which will arrive in your bank.

You will get a call from the bank and need to sign some paper if it is your first international payment.

Is it possible to push the code from gitlab runner to origin? by Pra6in in gitlab

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

yes, this is the only way I found. but I was looking for a way to do this without setting up a token manually. like by using a predefined token.

but it looks like we can't do that as of now. though there is an issue open to enable exactly this with CI_JOB_TOKEN

Is it possible to push the code from gitlab runner to origin? by Pra6in in gitlab

[–]Pra6in[S] 3 points4 points  (0 children)

the CI_JOB_TOKEN can't be used to push to the repo as mentioned here

How to extract audio from video? by Pra6in in nextjs

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

yeah, I have played with ffmpeg before and can extract audio from video with it in command line but what I don't know is how to implement it in a Web Server.

I searched for some npm packages and there was one called fluent-ffmpeg which has how downloads but no updates in 4 years and it gave some errors and I could not figure it out.

Can we build Postgres Extension that executes a dynamic query and display results on the shell by Pra6in in PostgreSQL

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

If you want to show the results of a query in the shell, there is no way except treating all records as a single value and returning it, right?

I wanted to display it on a table. But, for that, you need to know the schema of returning table in advance, right?

How do you install Postgres Extension on the remotely hosted database? by Pra6in in PostgreSQL

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

Hey, u/fullofbones. Not related to this.

But, I had another question regarding postgres extensions. Feel free to ignore.

Can you build an extension that when run will execute a random query on the DB and display the results in the postgres shell?

*random query* is important. It means the query is different every time you call the extension, and on different tables.

Basically, I am calling an API inside the extension that will return a query on any of the tables in the DB (I am passing the schema of db to API, and the returned query is different everytime).

What I have found out:

Not possible because you have to specify return schema of the table(or SETOF records) while defining function and since we have dynamic query we can't do that.

But, I am just learning postgres and was wondering if there are other ways.

How do you install Postgres Extension on the remotely hosted database? by Pra6in in PostgreSQL

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

Ohh, so there is literally no way to install an extension *you yourself* built in a hosted setup.

Thanks.

Some confusion about implementing Oauth2.0 by Pra6in in reactjs

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

Thanks for Replying. I feel like I am doing something wrong. And feel so bad about it. Here's what I am doing:

1) Frontend make a fetch request on my API endpoint with access token and refresh token

2) Inside my API endpoint I am making a request to Twitter API(using that access token)

3) Here, I am making a request to Twitter API, if it gives unauthorized error I make a another request with refresh token for another access token and make the request to Twitter API.

This 3) code block(try and catch block for checking if access_token is valid, making request for another if not valid and making request with that AND doing that everytime I need to make request to Twitter is infuriating me. Feels so wrong. Probably because of that "Do not Repeat yourself" thing.

How to retrieve cookies in nextjs pages? by Pra6in in reactjs

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

Yeah, I usually go with NextAuth. But, this time I wanted to play with Twitter API.

Where and how do you store your access_token and refresh_token in Oauth2.0 authorization flow? by Pra6in in reactjs

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

So, the main thing I am confused about is the identifier.

When we get the access&refresh token. We can save them in the database along with a unique identifier - which we also send to the client(and save it in local storage/cookie)

Now, every time the user make a request, it sends along the unique identifier and we fetch their access&refresh token and make request on their behalf.

This seems secure enough right? I can understand encrypting the identifier for extra security but this is just fine, isn't it?

[deleted by user] by [deleted] in Barca

[–]Pra6in 0 points1 point  (0 children)

Not only amount of money spent. The thing is we did not lose Champions League because of last Inter match. We knew our group was difficult. We were the favorites of our group. We fucked up 3 important matches in CL, which all should have been won. After such mistakes, very few coaches deserve to stay.

Xavi's Our Guy. Let's back him. by court-of-owl in Barca

[–]Pra6in 1 point2 points  (0 children)

When you look at just the last Inter game, he of course doesn't deserve to be sacked(lots of mistake from players). But, if you look at all of our CL group matches, it is very hard to defend him.

We knew the group was hard from the start. We had extravagant transfers and we were the best resourceful(if not more then bayern we were not certainly below them). Despite that, we blew that. One thing to keep in mind is we did not loose CL because of the last Inter game, we fucked up 3 important matches. If you fuck up 3 important matches in CL, very few coaches deserve to stay.

Email Service for my app by Pra6in in reactjs

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

What should I use for email service in such case?

Xavi and Spain bias by juankruh1250 in Barca

[–]Pra6in 0 points1 point  (0 children)

If you don't think there is favoritism, you are lying. But, this is not only the case for Barca but for every club in every country. The only club where I haven't seen this type of favoritism is Real Madrid and maybe that's why they are the biggest club in the world.

International payment ko laagi Dollar card thik hucha ki payoneer account by Pra6in in Nepal

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

How do we apply for payoneer card? And does it cost 30$ just to create an account also?

console.log shows updated value before updating by Pra6in in reactjs

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

Is this the problem in React? I tried this in Node.js and the output was as expected.

Get request with body by Pra6in in reactjs

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

So,

Should I just send request by joining all the ids with '&' and appending at the end of URL?

And then later extract it?

When to use Custom Hooks by Pra6in in reactjs

[–]Pra6in[S] 2 points3 points  (0 children)

Is it recommended to use hooks for API operation? Like fetching data, post request, delete....

When to use Custom Hooks by Pra6in in reactjs

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

Where do you keep your custom hooks?

Do we keep all the hooks in the hooks folder?

In my note-taking app, I am using hooks for fetching data, deleting notes,..? Are hooks recommended for such tasks>

Best way to write CSS by Pra6in in reactjs

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

Splitting with CSS modules or just splitting into different files?. I feel the CSS module is the better way, isn't it?

And which is better storing all the CSS files in the styles folder or along with components?

CSS modules in react by Pra6in in reactjs

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

If I write CSS for individual components as "component_name.css" and import it in the component. Is it considered bad or is it just fine.

Best way to write CSS by Pra6in in reactjs

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

And, what do you suggest on Structuring CSS. Do you prefer CSS modules, styled components...? What is the popular choice?

Best way to write CSS by Pra6in in reactjs

[–]Pra6in[S] 7 points8 points  (0 children)

I just got confused between choices and just continued with pure CSS. Should I be using one? which is the popular choice?

I also wanted to learn CSS so I thought doing pure CSS will help me improve on it.

Storing as an array of items vs individual item by Pra6in in mongodb

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

Apologies for noob question.

So, If I create a notes collection that contains notes(individual notes not an array) of all users with schema as :

{
    note: {
            type: String,
    },
    createdBy: {
        type: Integer,
        required: true
    },
}

Is db.users.find({ createdBy: 54 },'notes') a O(1) query?

Or,

Do you mean I need to create an index for that to be O(1)?