Skip to content

Instantly share code, notes, and snippets.

function findModalFooter1(children: ReactNode): ReactNode {
return React.Children.toArray(children).find((child: ReactNode) => {
if (!child || !React.isValidElement(child)) {
return null
}
if (child.type === 'ModalFooter') {
return child
} else if (React.Children.count(child) > 0) {
return findModalFooter(child.props.children)
}
@marufsiddiqui
marufsiddiqui / 1.json
Last active September 6, 2023 14:03
json
[
{
"date": "2023-09-01T05:24:47.000+00:00",
"feedback": "title: Hervorragend, feedback: Ich habe dieses i Phone ca. 2 Wochen und bin mehr als zufrieden. \nDie Kamera ist mega gut und macht qualitativ hochwertige Bilder.\nAuch das Laden geht sehr schnell. Und der Akku des Handys hält bei meinem Gebrauch mehr als einen ganzen Tag. \nDas Design ist auch hochwertig und gut verarbeitet. Alles in allem kann man nicht meckern. \nAuch die Kopplung mit IPad und Apple Watch funktioniert wie immer einwandfrei. \n\nAlles in allem bin ich sehr zufrieden mit dem Kauf und bereue es nicht. \nIch nutze Apple seit circa 2 Jahren und bin immer wieder zufrieden !, advantages: Kamera gut, Batterie gut"
},
{
"date": "2023-08-31T21:26:10.000+00:00",
"feedback": "title: Super, feedback: Meine Freundin hat mir zuerst das 14 Pro Max Geschenkt nach langem überlegen ob sie iPhone mag oder doch bei Samsung bleibt hab ich ihr das 14 pro in Gold geschenkt weil das Pro zu groß ist für Sie! Jetzt sind wir beide bei App
targetingEntries.forEach(([key, value]) => {
if (key && value) {
googletag.cmd.push(() => googletag.pubads().setTargeting(key, value))
}
})
googletag.cmd.push(() => {
const slots = googletag.pubads().getSlots()
if (slots?.length) {
googletag.pubads().refresh()
export const FULL_WIDTH_DIMENSION_CATEGORY = {
xs: {
width: 330,
height: 159,
},
sm: {
width: 463,
height: 159,
},
md: {
@marufsiddiqui
marufsiddiqui / testResultsProcessorNodeEnv.js
Created May 19, 2021 09:56
Adds jest-env node for the tests that can run in node only
const fs = require('fs')
const _prependNodeDocBlock = filePath => {
const docBlock = `/**
* @jest-environment node
*/
`
fs.readFile(filePath, 'utf8', (error, result) => {
if (error && error.code !== 'ENOENT') {
return console.log(error)

Disable Device Enrollment Program (DEP) notification on macOS Catalina.md

With full reinstall (recommended)

   a. Boot into recovery using command-R during reboot, wipe the harddrive using Disk Utility, and select reinstall macOS

   b. Initial installation will run for approximately 1 hour, and reboot once

   c. It will then show a remaining time of about 10-15 minutes

@marufsiddiqui
marufsiddiqui / useE2EMock.ts
Created January 27, 2021 11:47
useE2EMock hook
import { useLocation } from 'react-router'
import { parse } from 'qs'
import { useEffect, useRef } from 'react'
interface Params {
refetch: () => void
shouldSkip?: boolean
}
export const useE2EMock = ({ refetch, shouldSkip = false }: Params): void => {
@marufsiddiqui
marufsiddiqui / App.js
Created October 20, 2020 13:51
useShowMore React hook
import React, { useCallback, useState } from "react";
import "./styles.css";
const useShowMore = ({ items = [], initialVisibleItems = 4 }) => {
const [filteredItems, setFilteredItems] = useState(
items.slice(0, initialVisibleItems)
);
const [expanded, setExpanded] = useState(false);
const hasMoreItems = items.length > initialVisibleItems;
@marufsiddiqui
marufsiddiqui / a9 grad prix strategy.txt
Created April 4, 2020 17:39
a9 grad prix strategy
1 - Do not take a training lap and forego all useless rewards.
2 - No qualification (Q1-Q2-Q3) driving.
3 - The required 6 conditions so that you have no time limit or choose the condition that has the highest time limit and make full use of it.
4 - Shop with 500 brands in the finals.
5- Drive just before the end. Then you can assess where you stand. Neither can you orientate yourself on your ghost. Go up a star if necessary.
The goal is to get into a group with bad drivers and end the group with rank 1 and get the only secure key.
1 - Keine Trainingsrunde fahren und auf alle nutzlosen Belohnungen verzichten.
2 – Keine Qualifikation (Q1-Q2-Q3) fahren.
@marufsiddiqui
marufsiddiqui / a9-reps-generator.js
Created November 10, 2019 13:44
Asphalt 9 reps generator per season
const generate = (startDate, seasonsLengthInDays = 28, repPerDay = 4000) => {
return new Array(seasonsLengthInDays).fill(null).map((_, i) => {
const today = new Date(startDate);
const tomorrow = new Date(startDate);
today.setDate(today.getDate() + i)
tomorrow.setDate(tomorrow.getDate() + i + 1)
return [`${today.toLocaleDateString()} - ${tomorrow.toLocaleDateString()}`, repPerDay * (i + 1)].join(',\t')
})
}