Setup sanity cli by running this command:
npm install --global sanity@latestCreate sanity project with nextjs by running this command:
npx sanity init| from selenium import webdriver | |
| from selenium.webdriver.common.by import By | |
| from selenium.webdriver.chrome.options import Options | |
| from selenium.webdriver.support.ui import WebDriverWait | |
| from selenium.webdriver.support import expected_conditions as EC | |
| import time | |
| TIMEOUT = 5 | |
| chrome_options = Options() |
| // Paste this code inside your App.js | |
| import { NativeWindStyleSheet } from 'nativewind'; | |
| NativeWindStyleSheet.setOutput({ | |
| default: "native" | |
| }) |
| // index.js | |
| // where your node app starts | |
| // init project | |
| var express = require('express'); | |
| var app = express(); | |
| // enable CORS (https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) | |
| // so that your API is remotely testable by FCC | |
| var cors = require('cors'); |
| <div class="container"> | |
| <button id="start">start</button> | |
| <button id="stop">stop</button> | |
| <p id="result">Hello</p> | |
| </div> |
Setup sanity cli by running this command:
npm install --global sanity@latestCreate sanity project with nextjs by running this command:
npx sanity init| function checkCashRegister(price, cash, cid) { | |
| let change = []; | |
| let changeDue = cash - price; | |
| console.log('dueAmount:',changeDue); | |
| const currency = { | |
| PENNY: 0.01, | |
| NICKEL: 0.05, | |
| DIME: 0.1, | |
| QUARTER: 0.25, | |
| ONE: 1, |
| function telephoneCheck(str) { | |
| const phoneRegex=/^(1 |1)?((\d{3})|(\(\d{3}\)))(-| |)(\d{3})(-| |)(\d{4})$/; | |
| //breakdown | |
| // ^(1 |1) starts with 1 whitespace or 1 and this is optional this may or may not be present; | |
| // ((\d{3})|(\(\d{3}\))) braket and consecutive 3 digit or with whitespace | |
| // (-| |) - and whitespace after that or no - | |
| // (\d{3}) three digit | |
| // (-| |) - and whitespace after that or no - | |
| // (\d{4})$ and end with four digit | |
| return phoneRegex.test(str) |
| function convertToRoman(num) { | |
| // Decreasing order of the value is important because we substract the value from the num | |
| // eg:To represent the number 4, you would write 'IV.' In this case, 'I' (1) is subtracted from 'V' (5), resulting in 4. | |
| const romanNumerals = [ | |
| { value: 1000, numeral: 'M' }, | |
| { value: 900, numeral: 'CM' }, | |
| { value: 500, numeral: 'D' }, | |
| { value: 400, numeral: 'CD' }, | |
| { value: 100, numeral: 'C' }, | |
| { value: 90, numeral: 'XC' }, |
| function palindrome(str) { | |
| const palindromeRegex=/[^a-zA-Z0-9]/ig; // regex for remove all non blank characters from the string | |
| const res= ''.concat(str).replace(palindromeRegex,'').toLowerCase(); //remove all non blank characters from the string, after removing non alphabatic characters convert all into lowerCase or upperCase | |
| // Check for every characters in str by spliting the str and comparing with reversed array after spliting | |
| for(let i=0;i<res.split('').length;i++){ | |
| let char=res.split('')[i]; | |
| let reverseChar=res.split('').reverse()[i]; | |
| if(char!==reverseChar){ | |
| // check the char with reverse char with same position | |
| return false; |
| // Define a function called orbitalPeriod that takes an array 'arr' as input. | |
| function orbitalPeriod(arr) { | |
| // Define constants for GM (gravitational constant * Mass of Earth) and Earth's radius. | |
| const GM = 398600.4418; | |
| const earthRadius = 6367.4447; | |
| // Use the map() method to transform the input array. | |
| const result = arr.map((item) => { | |
| // Calculate the semi-major axis for the current element. | |
| const semiMajorAxis = earthRadius + item.avgAlt; |