Skip to content

Author: admin@master

How to Login with Google?

I am trying to implement a google oauth 2.0 login without using any libraries in my Node.js application. I have created an app on the Google API console with the redirect url as http://localhost:3000. During login my response_type is code which returns a one-time use code that needs to be exchanged with the t…

Typescript: React event types

What is the correct type for React events? Initially I just used any for the sake of simplicity. Now, I am trying to clean things up and avoid use of any completely. So in a simple form like this: What type do I use here as event type? React.SyntheticEvent<EventTarget> does not seem to be working as I g…

VueJS – Transition not working

I’m trying to apply a transition whether a component has to be shown or not. I’m wondering why this simple example is not working: http://jsfiddle.net/bf830qoq/ Javascript HTML CSS Answer Your syntax is wrong, you have to use name attribute for transition, like following: See working fiddle.

Regex for a valid hashtag

I need regular expression for validating a hashtag. Each hashtag should starts with hashtag(“#”). Valid inputs: 1. #hashtag_abc 2. #simpleHashtag 3. #hashtag123 Invalid inputs: 1. #hashtag# 2. #hashtag@hashtag I have been trying with this regex /#[a-zA-z0-9]/ but it is accepting invalid inputs als…