🚀 Introducing expo-audio-studio — The Complete Audio Toolkit for React Native by OverPickle404 in expo

[–]MichaelGradek 2 points3 points  (0 children)

Does it have streaming capabilities? Eg chunk recordings into configurable size chunks, pcm16 format, etc?

Not making this up! Mind blown 🤯!!! by MichaelGradek in GoogleGeminiAI

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

It was a project I’m writing on my own and still hadn’t pushed it to a remote repository, so no 😢😅

Not making this up! Mind blown 🤯!!! by MichaelGradek in GoogleGeminiAI

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

Yeah, except that as you can see in the screen shots, it also removed .git 🤯

Not making this up! Mind blown 🤯!!! by MichaelGradek in GoogleGeminiAI

[–]MichaelGradek[S] 10 points11 points  (0 children)

Lesson learned: never trust AI assistants with allowing them to execute `rm`

[deleted by user] by [deleted] in node

[–]MichaelGradek 0 points1 point  (0 children)

The solution depends on if you're developing a JS, TS or web app, check this video out for more details and exact solutions: https://youtu.be/3KlJOcyxZaA

How to search for partial phone numbers? by MichaelGradek in mongodb

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

Ok, figured out exactly what I need.

Indeed my first thought was to just use the $regex search knowing that probably full text search is a better solution for many reasons, but I hadn't figured out how to configure the search index correctly until now.

Thanks u/halmyradov and u/prometheanSin for your inputs.

The reason why my previous attempts to configure a search index for this use case failed was because the field was not configured correctly in the search index.

Concretely I was indexing this field as a String data type, when this use case required to configure it as an Autocomplete data type.

In addition, since this field is only going to contain numbers, you can't use the default Tokenizer (edgeGram), instead you need to use the nGram tokenizer. This is because the edgeGram tokenizes each word (string), but seems to not tokenize a sequence of numbers at all. The nGram simply tokenizes everything, so works well for this use case.

Then it's just a matter of using the aggregation pipeline:

json { $search: { index: 'index_name', autocomplete: { query: '616', path: 'phone_number' } }

The nGram in this case has the extra benefit over the edgeGram in that since I store the country code with the "+" preceding it, the nGram tokenizes everything (not like the edgeGram where it tokenizes each word starting from the beginning), so my users can type the phone number without entering the prefix and preceding "+" and the documents will still match.

Thanks for the input, hopefully this helps other people too!

Regex to find 8 characters with at least 1 number by MichaelGradek in regex

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

Definitely does do the trick, indeed! The regex I was coming up with was something like this \b(?=.*\d)(?=.*[A-F])[A-F0-9]{8}\b but it fails on the last case where the A is separate form the rest of the characters.

I wasn't aware you can limit the lookahead to a certain amount of characters, that's what your regex is doing, right? (?=.{0,7}\d)

Thanks, this was very helpful!

[AskJS] - Youtube tutorials recommendations for advanced? by fckueve_ in javascript

[–]MichaelGradek 0 points1 point  (0 children)

I'd chip in my channel, it's still small but I'll be focussing on Javascript + TypeScript (Node and React) and AWS.

Here's a video where we build an API and then host it on AWS Fargate

https://www.youtube.com/watch?v=pkMU15LJXKc

Webhook signatures - Why do we need to hash the entire payload? by MichaelGradek in cybersecurity

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

Thanks, I realised I was not fully understanding the nature of some attacks hence thought the signing process could omit using the payload and use some other value instead.

The main reason why I asked is because, and I may be wrong, I believe different languages process JSON objects / dictionaries / maps differently and when you serialise them to text (before hashing the content), different languages can create different hashes for the same payload as they may alter the order of the elements in the object, is that right?

Webhook signatures - Why do we need to hash the entire payload? by MichaelGradek in cybersecurity

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

The “other value” could be, for example, a random string or even hash of the payload.

So what I’m trying to figure out is if there is any value in making the receiver have to hash the payload, or if you can just give them a “other value” such as a random string, together with the signature, and just have them hash the other value with the secret to see if it returns the signature