This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use client"; | |
import { Transition } from "@headlessui/react"; | |
import { | |
ChatBubbleLeftIcon, | |
PaperAirplaneIcon, | |
XMarkIcon, | |
} from "@heroicons/react/24/outline"; | |
import clsx from "clsx"; | |
import { noop } from "lodash"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------------------------------- | |
-- Queries related to distribution of metadata. | |
-- Find the number of users per profile. | |
SELECT count(id), Profile.name | |
FROM User | |
WHERE User.IsActive = true | |
GROUP BY Profile.name | |
-- Find the distribution of Apex classes per namespace. | |
select count(id), NameSpacePrefix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import OutsideRoot from './OutsideRoot'; | |
const Modal = () => { | |
return ( | |
<OutsideRoot> | |
<MyModalComponent /> | |
</OutsideRoot> | |
); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState } from 'react'; | |
import { createPortal } from 'react-dom'; | |
import { randomInt } from '../services/utils'; | |
const outsideRootContainer = document.getElementById('outside-root'); | |
/** | |
* Used to render React components outside the | |
* `<div id="root"></div>` element. Handy to show | |
* alerts, modals, etc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const x = ['x'] | |
const y = ['y'] | |
const arr1 = [x, y] // [['x'], ['y']] | |
const arr2 = [...x, ...y] // ['x', 'y'] | |
const a = {a: 'a'} | |
const b = {b: 'b'} | |
const obj1 = {x: a, y: b} // { x: {a: 'a'}, y: {b: 'b'}} | |
const obj2 = {...a, ...b} // {a: 'a', b: 'b'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { nanoid } from 'nanoid'; | |
const data = [ | |
{ | |
component: 'Test', | |
}, | |
{ | |
component: 'Test1', | |
props: { | |
name: "Santi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Suspense } from 'react'; | |
const DynamicComponents = (props: any) => { | |
return ( | |
<Suspense fallback={<></>}> | |
{React.createElement(React.lazy(() => import(`./${props.component}`).catch(() => {})), props)} | |
</Suspense> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Test2 = (props: any) => (<div>Test2 - {props.name}</div>) | |
export default Test2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Test1 = (props: any) => (<div>Test1 - {props.name}</div>) | |
export default Test1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {ErrorHandler, Inject, Injectable, PLATFORM_ID} from '@angular/core'; | |
import {isPlatformBrowser} from '@angular/common'; | |
@Injectable() | |
export class MyErrorHandler implements ErrorHandler { | |
constructor(@Inject(PLATFORM_ID) private platformId: any) { | |
} | |
handleError(error: any): void { |
NewerOlder