Skip to content

Instantly share code, notes, and snippets.

View iamparthaonline's full-sized avatar

Partha Roy iamparthaonline

View GitHub Profile
const path = require('path');
module.exports = {
"stories": [
"../.stories/**/*.stories.mdx",
"../.stories/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
"storybook-addon-pseudo-states",
import { addons } from '@storybook/addons';
addons.setConfig({
isFullscreen: false,
showNav: true,
showPanel: true,
panelPosition: 'right',
enableShortcuts: true,
isToolshown: true,
initialActive: 'sidebar',
// You are given a string S consisting of characters 0, 1, and ?.
// You can replace each ? with either 0 or 1. Your task is to find
// if it is possible to assign each ? to either 0 or 1 such that the resulting
// string has no substrings that are palindromes of length 5 or more.
/** For checking if a string is palindrom or not */
function isPalindrome(string) {
return string == string.split("").reverse().join("");
}
<template>
<div class="app">
<button
:disabled="loading || !configurationExists"
@click="login"
>
{{ ( loading || !configurationExists ) ? 'Please wait' : 'Continue with Google' }}
</button>
</div>
</template>
{
"serviceConfigurations": {
"google": {
"clientId": "YOUR_CLIENT_ID.apps.googleusercontent.com",
"secret": "YOUR_SECRET",
"loginStyle": "popup"
}
},
"env": "development"
}
// server/main.js
Meteor.startup(() => {
ServiceConfiguration.configurations.upsert(
{service: 'google'},
{
$set: {
...Meteor.settings.serviceConfigurations.google,
},
},
);
/** Functional Component */
import React, { useState, useEffect } from "react";
const FunctionalComponent = (props) => {
const [x, setX] = useState(1);
useEffect(() => {
console.log("Functional Component Useeffect - Value of X --", x);
});
return (
/**
* Handling Forms and different events
* Conditional rendering
* Looping in react
*/
import "./style.css";
import { useState } from "react";
const RenderResult = (props) => {
const { showResult, firstName, removeHandler } = props;
import { useState } from "react";
import { Link } from "react-router-dom";
const dogsListAPI = "https://dog.ceo/api/breeds/list/all";
const DogsComponent = () => {
const [breeds, setBreeds] = useState([]);
const [image, setImage] = useState();
const [currentBreed, setCurrentBreed] = useState("");
const getBreedsList = () => {
/**
* Handling Forms and different events
* Conditional rendering
* Looping in react
*/
// import "./style.css";
import { useState, createRef } from "react";
const RenderResult = (props) => {
const { showResult, firstName, removeHandler } = props;
const arrayOfCharacters = firstName.split("");