Quantcast
Channel: User Louis Coulet - Stack Overflow
Browsing latest articles
Browse All 38 View Live

Comment by Louis Coulet on Invalid hashing in Firebase Cloud Storage Rules...

Yes indeed hashing is only listed for Firestore rules in the doc, however as you can see, it is actually defined and somehow works, so I assumed it is just missing from the doc.

View Article



Comment by Louis Coulet on Invalid hashing in Firebase Cloud Storage Rules...

Thank you, it works as a charm! I was aware of the necessary bytes to string conversion, but I may have messed up my rule's code as I was destabilized by the debug output. Thank you for your help,...

View Article

Comment by Louis Coulet on Is there any standard firestore query to get...

Hi @iusting, there is no built-in way to get a collection size, but I wrote an article on how to achieve this: medium.com/firebase-tips-tricks/…

View Article

Comment by Louis Coulet on Set custom thumbnail via YoutubeAPI doesn't work....

Here is the error message: "The authenticated user doesn't have permissions to upload and set custom video thumbnails."

View Article

Comment by Louis Coulet on Error: child failed: path argument was an invalid...

Another typo is that you are missing the value prop on your input, I suggest to have a look at the doc here: reactjs.org/docs/forms.html#controlled-components

View Article


Comment by Louis Coulet on How can I make one property non-optional in a...

Thanks, one more solution! And it works: typescriptlang.org/play?#code/…

View Article

Comment by Louis Coulet on How to narrow the return type of array.groupBy in...

Thank you for your suggestion, but my question is about typing, not about the implementation.

View Article

Comment by Louis Coulet on How can I make one property non-optional in a...

A useful package makes for a valid solution. I did not know about this package, thank you for the response.

View Article


Comment by Louis Coulet on Firebase Firestore Increment FieldValue does not...

I just checked and it still works with update, you need to use the dot notation to update nested fields: firebase.google.com/docs/firestore/manage-data/…

View Article


Comment by Louis Coulet on Attaching end listener to filestream in a promise

Thank you for your reply. I understand your 1st paragraph, this is what I expected. But I am surprised by the second: yes we (programmers) know that the process can safely exit here because we know...

View Article

Comment by Louis Coulet on How to give Typography-like style to an input...

I cannot try it now but it looks promising, thank you for sharing!

View Article

How to port trial days left when updating a subscription through Stripe...

My app offers two subscription plans:plan A: 10 €/month, 15 days of free trialplan B: 20 €/month, 15 days of free trialI am using Stripe's Customer portal to let users manage their subscription to my...

View Article

Answer by Louis Coulet for What service account roles to deploy a scheduled...

The answer is: add role "Cloud Scheduler Admin".The gotcha is: roles set to a service account in one project do not propagate to the same service account in other project.The nice lesson is: add...

View Article


What service account roles to deploy a scheduled Cloud Function?

To deploy my Firebase project, I have setup a service account with the roles:Cloud Functions AdminFirebase AdminService Account UserIt works fine with Hosting and Cloud Functions triggered by Firestore...

View Article

Material UI and ReactJS, how to style a selected ListItem using withStyles?

I want to change the style of the selected ListItem as shown in this codesandbox.In the sandbox I use a global css stylesheet, but I would like to use the withStyle technique.How can I do it?What...

View Article


Answer by Louis Coulet for Why can't my React app re-render eventhough I'm...

Every time your`component re-renders, it constructs a new EventSource. I suggest you move the instanciation of your EventSource inside the useEffect hook as such:useEffect(() => {...

View Article

Answer by Louis Coulet for Is there a way to prevent getting photos randomly...

The whole point of asynchronous functions is not to block the execution of the script so that several operations can run concurrently.In your case getDownloadURL and setExArr are asynchronous, as a...

View Article


Why does typescript server in vscode overlooks null possibilty? [duplicate]

I have a variable db that can be null:import * as Sqlite3 from "better-sqlite3";export let db: null | Sqlite3.Database = null;export function initDb(filepath: string) { db = new...

View Article

Answer by Louis Coulet for How can I minimize firestore reads in the...

As pointed out in the comments by Dharmaraj, you set multiple subscriptions to the authentication state. This is because you call onAuthStateChanged in the body of your component, so it is executed on...

View Article

Firestore: How to insert a document with automatic id while enforcing unique...

In Firestore, I have a collection of fruits containing documents with automatically generated ids, and a name property.I want to insert a new fruit document, with an automatically generated id, and...

View Article

How to declare a type from an object literal in typescript?

I have an object:const foo = { bar: 123, baz: "lorem" };I would like top obtain the type of this object automatically:type Foo = { bar: number, baz: string };How can I do this?

View Article


Answer by Louis Coulet for setting firebase storage rule to watch for a piece...

Your post raises two questions:How to pass data to storage rules?How to check for authentication status without using firebase authentication?✉️ Passing data to storage rulesFile pathYou could save...

View Article


Answer by Louis Coulet for ImageMagick convert thumbnail output differs based...

AnswerAs explained by fmw42, the difference is in the metadata, it can be removed by using the -strip option. This script shows that the output is now stable, it shows that the produced files are equal...

View Article

Image may be NSFW.
Clik here to view.

ImageMagick convert thumbnail output differs based on file name

I noticed that the binary output of convert -thumbnail differs based on file name (or inode or other metadata), it should be noted that visually there is no difference. Here is a bash script that...

View Article

Answer by Louis Coulet for Invalid hashing in Firebase Cloud Storage Rules...

After trying with emulators and the deployed app, it seems that hashing.sha256 does not work on dynamic data in any environment. The behavior is consistent, so I filed a feature request to add this...

View Article


Answer by Louis Coulet for Difference between Firestore Query stream & get?

Yes, using stream over get will reduce the memory consumption of your Cloud Function! I have experienced it first-hand: my function's memory went from 1GB to 200MB when I replaced get with stream.To...

View Article

Answer by Louis Coulet for Stripe listen and forward multiple webhooks

I find myself consulting this question again one year later, so let me summarize the subject based on @karllekko's helpful comment:Stripe emits events of various types.A webhook associates a selection...

View Article

Stripe listen and forward multiple webhooks

I have two webhooks in my Stripe account, each pointing to a different endpoint:first webhook: endpoint: https://example.net/webhook, secret: whsec_example1, events: checkout.session.completedsecond...

View Article

Failure to get media URL from LinkedIn Post API find by author

I want to list the URLs of the assets posted to a LinkedIn organization. I use the Post API to list the posts, and would like to use response decoration on each post media, as such:const url = new...

View Article



How to prevent react-quill to insert a new line before list when re-loading...

Using react-quill, I write a list within text, store the content into external storage, reload the content into quill: a new <br> is inserted before the list, and it happens on each reload.Any...

View Article

Attaching end listener to filestream in a promise

While studying nodejs streams, I wanted to check what happens if the end listener is added after a filestream has been consumed and closed.I am puzzled by what happens: no error event, no exception...

View Article

Firebase authentication provider silently changes from password to google.com

I use firebase authentication for my web app with three providers: email-password, google, or facebook. I have enabled the option "One account per email address".When a user signs up using...

View Article

Why separate jobs in Github Actions instead of adding steps?

In this Github Actions deployment script example, the author separate the build and deployment into distinct jobs.Given that:these jobs run sequentially (needs: build)and on the same runner (runs-on:...

View Article


Answer by Louis Coulet for Error while trying to deploy to Google App Engine:...

The solution is to delete old unused version from App Engine through the console, because these versions seem to count toward the project-level max instances even if not used anymore. It makes sense...

View Article

How to give Typography-like style to an input element with Material-ui?

I would like my Typography field to become editable, so I transform it into an input.Now I would like this input to have the same style.How to do it?I tried copying the produced css to the input, but...

View Article

How can I make one property non-optional in a typescript type?

I have this type:type User = { id: string; name?: string; email?: string;}And I would like to construct a similar type with name non optional:type UserWithName = { id: string; name: string; email?:...

View Article


Answer by Louis Coulet for What's the Cypher script to delete a node by ID?

Update 2023: the function id is now deprecated, it is advised to use the function elementId instead.It should be noted that the id returned by elementId looks like...

View Article


Error while trying to deploy to Google App Engine: max instances limit

I am trying to deploy a new version of my app on Google App Engine, but it fails with this error:ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: You may not have more than 32 total max instances in your...

View Article
Browsing latest articles
Browse All 38 View Live




Latest Images